A line is divided in 3 sectors x,y and z

How can I define a Python, VB or C# code to solve following problem? A line is divided in 3 sectors x,y and z. The length of the line l should be here constant. Therefore, I would like change the length of any sector how I want and the length of other two sectors will change automatically, but the sum of the length of the 3 sectors should not be more than the defined length l. Here is a sketch of the problem.
line dvieded in 3 sections

here is an exempel. l=15 x=3 y=3 z=l-(x+y) or x=3 y= l-(x+z) z=5 or x= l-(y+z) y= 6 z=5 etc. however the sum of all variabels must be equal to the defined length

Thanks in advance for your help

Duplicate thread

1 Like