How to find a ecuation?

Good morning!

I have a quaestions. My drawing is a schematic of an assembly compose by separate parts and I need resources to find the dimension of the green line (both lines are equal and at 45 degrees). This line must get longer when the the 3 dimensions are changed (The length, the wide and the diameter). I know I can relate to an ecuation, but I can't figurate right now. Do you know some online resources which can help or can you give an idea?

SolidworksAssemblies