drawing circle

Hello
I am new to programming and need some support on understanding a certain concept.
I would like to draw a circle with points user defined given as mouse click - like a best fit circle. I am not sure where to start whats the logic of this problem.

My idea is as follows - I would like to first find few points which can lie on the circle but i dont know how to do this. can someone guide me on the logic here

thanks for the support
The geometry is illustrated here
http://www.mathopenref.com/const3pointcircle.html

though of course on a computer you would use a technique not needing compass and ruler, to calculate the mid-points, intersection and radius.

It is discussed in terms of coordinates here:
http://www.had2know.com/academics/circle-through-three-points.html
Last edited on
thanx for the link

i saw this but in my case points are user defined. ie in a given window with grid points user can click many points and then i need to draw a best fit circle. any clue on this ?
i saw this but in my case points are user defined.

If I'm taught how to drive on a road with a north-south orientation, do I not follow the same procedures on a road with different orientation?

It doesn't matter who supplies the points. The process is the same.
am i wrong when i think that when i have random points, some of the points might not even lie of the circle ?
Looks like you're into the topic of curve-fitting

https://en.wikipedia.org/wiki/Curve_fitting#Fitting_a_circle_by_geometric_fit

am i wrong when i think that when i have random points, some of the points might not even lie of the circle ?

If there are more than three points, it's possible than the best-fit might be a circle which passes through none of the points.
Last edited on
am i wrong when i think that when i have random points, some of the points might not even lie of the circle ?

If you have more than three (or have three that are colinear,) that's certainly possible.
ok cire thats the reason why i could not use the three point.

for example with 5 point the method doesnt seem to work
Topic archived. No new replies allowed.