Friday, March 9, 2012

Form a circle from 3 points

Given 3 points which are not colinear (all on the same line) those three points uniquely define a circle. But, how do you find the center and radius of that circle?
Propose a simple algorithm for this.



Strategy:

1. join two pairs of vertices.
2. Form the equations for the two lines.
3. Form the equations of the perpendicular bisectors of each of the equations obtained in step 2.
4. Solve the two equations from step 3. The point of intersection is the centre.
5. calculate the radius.

Useful Links:
http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=geometry2

No comments:

Post a Comment