java circle recognition from an arraylist of points

前端 未结 4 1717
情话喂你
情话喂你 2020-12-19 18:07

I currently have an arraylist of points from a freehand drawing on a canvas. I was wondering if there is a simple algorithm to detect if that shape represents a circle.I hav

4条回答
  •  Happy的楠姐
    2020-12-19 18:56

    enter image description here

    If I interpret your question correctly, you want to know if all the points are on a circle.

    As illustrated in the picture, we pick three points A, B, C from the list and compute the origin O of the presumed circle. By checking the distance between O and each point from the list, we can conclude whether these points are on a circle.

提交回复
热议问题