Is there a circle class in Java like the Rectangle class

后端 未结 3 1376
清歌不尽
清歌不尽 2020-12-18 21:43

Hey I was writing a quick program and something came across where I need to use a circle for collision detection. But as far as I know, there is only the Rectangle class tha

3条回答
  •  渐次进展
    2020-12-18 21:59

    There is an ellipse2D, this is in the same way that a square is a rectangle a circle is an ellipse.

    http://docs.oracle.com/javase/7/docs/api/java/awt/geom/Ellipse2D.html

提交回复
热议问题