Class Circle

  • All Implemented Interfaces:
    Shape

    public class Circle
    extends java.lang.Object
    implements Shape
    Circle that is defined by its center point and a radius, defined with float precision.
    • Constructor Detail

      • Circle

        public Circle​(Point2D center,
                      float radius)
      • Circle

        public Circle​(float x,
                      float y,
                      float radius)
    • Method Detail

      • getCenter

        public Point2D getCenter()
      • getCenterX

        public float getCenterX()
      • getCenterY

        public float getCenterY()
      • getRadius

        public float getRadius()
      • getDiameter

        public float getDiameter()
      • intersects

        public boolean intersects​(Circle other)
      • calculateDistance

        public float calculateDistance​(Point2D p)
        Returns the distance between the center of this circle and the specified point.
      • calculateDistance

        public float calculateDistance​(Circle other)
        Returns the distance between the center of this circle and the center of the specified other circle.