I'd like to make it possible for a user to drag the end of a line so that it bends in 2D. The line will be an arc when bent (section of a circle). The start point of the line will be fixed in terms of its position and angle/direction. The length of the line/arc will also remain constant. The angle/direction at the end of the line will point to some point P (the cursor position).
That should be enough to define the arc fully. However, it seems non-trivial to work out the parameters of the arc. This is because to work out the position of the end of the arc requires knowledge of the radius or angle at the end of the line and visa-versa. If I could just work out the radius the rest is easy.
Here are some relations:
angle at end = angle at start + length/radius
circle centre is perpendicular to start direction at distance radius from start position
circle centre is perpendicular to end direction at distance radius from end position
end direction is vector from end position to point P.
I need an equation for radius in terms of the arc start position, direction, arc length and point P. Putting the equations into Maxima to find a closed form solution using 'solve' didn't seem to come up with anything.