How can I draw a curve which is part of the circle (depending on the end point)?
Let:
cross(Mx,My)
(B->A)
(middleBC->C)
Let I((B.x + C.x) / 2, (B.y + C.y) / 2)
be the middle point of [BC]
and I'(I.x + I.y - C.y, I.y + C.x - I.x)
(90° rotation of C
around I
). Then the perpendicular to (BC)
going through I
is I + tII'
(for any real number t
). Likewise with B'
be the 90° rotation of A
around B
, the perpendicular to (AB)
going through B
is B + uBB'
(for any real number u
).
Now you just have to find the intersection point of these two lines. See here for related issues.