0

An "elbow connector" in MS-Word is a 3-segment line with a control point in the middle as shown

enter image description here

where if I move the yellow control point sideways, then the length of the two lines on either side change accordingly while the end points remain the same.

I am trying to understand how this works so that I can re-create this. Is there a "line equation" for such a line? How would I go about re-creating this?

  • 1
    Hello and welcome to GDSE; well in here we only discuss about visual things but if you want to code it then you must post your question in stackoverflow.com :) – Mr.Online May 20 at 8:30
  • 1
    I'm voting to close this question as off-topic because it's a programming question perhaps better suited for stackoverflow.com – Luciano May 20 at 9:39
0

I'm not a programmer, but that curve is = three line segments; one vertical between two horizontal. There's 5 placement numbers. Four of them are endpoint coordinates, say X1,Y1,X2,Y2 and the one, say S is the placement of the vertical piece as percents of the horizontal distance of the endpoints. S is between 0 and 1.

If you already can draw a line between points (A,B) and (C,D), then you draw three lines

left part starting from (X1,Y1), ending at (S(X2-X1)+X1, Y1)

mid part starting from (S(X2-X1)+X1, Y1), ending at (S(X2-X1)+X1, Y2)

right part starting from (S(X2-X1)+X1,Y2), ending at (X2,Y2)

S(X2-X1)+X1 is, of course, calculated only once.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.