Hi,
I'm working on a cad type thing and i need to draw an arc in 2d from three points - i believe there is only one solution.
I really need a little code to help me out here, or at least fully solved eqs in terms of the 3 points, and anything in addition would be great (ie radius/sweep + centre etc)
I'm drawing in openGL / GDI - is there an easier way? not sure how to use gdi or gl to draw an arc from 3 points
thanks
faraz
Well, I'm not sure of an API that will plot an arc given 3 points, but you could always write one. :)
The math involved is pretty simple, mostly geometry, a little alegbra, maybe some trig.
Given the arc ABC, draw two length segments AB and BC.
Draw the perpendicular bisector at AB and BC. Where they intersect is the center of the circle (arc), D.
Now you can draw the arc from AC with centerpoint D.
The centerpoint of AB is the point ((Ax+Bx)/2,(Ay+By)/2)
The centerpoint of BC is the point ((Bx+Cx)/2,(By+Cy)/2)
Compute the line through each of those points and calculate the intersection.
Kdo