java circle recognition from an arraylist of points

前端 未结 4 1720
情话喂你
情话喂你 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条回答
  •  抹茶落季
    2020-12-19 18:39

    Reading your comment, an easier method to draw a circle is for the user to click the center point, then drag the radius of the circle. It's a lot less calculation, and easier for the user to draw.

    You can do the same thing with a rectangle, or any other convex polygon.

提交回复
热议问题