OpenGL/C++ How to get cross point from perpendicular line (B->A) and (middleBC->C) : I can not put questions in one line also here they are:

How to draw a curve which is part of the circle(depending on the end point)

Let:

 - A=(Ax,Ay) be the first point (A)
 - B=(Bx,By) be the second point (B)
 - C=(Cx,Cy) be the end point (mouse location) (C)
 - MBC(MBCx, MBC.y) are middle between B and C
 - p2 and p2 are line AB
 - p4 and p3 are line CD

Question:

 - How to get cross(Mx,My) point from perpendicular line (B->A) and (middleBC->C)

 -[![enter image description here][1]][1]


  [1]: http://i.stack.imgur.com/z7cYS.png

Any ideas how to code it?

This question is relatet to [this](http://stackoverflow.com/questions/39274174/opengl-how-to-draw-curves-being-part-of-circle-depends-of-last-point-location-wi) topic