Class CircleShape



  • public class CircleShape
    extends PolygonShape
    Circle shape class
    • Constructor Detail

      • CircleShape

        public CircleShape​()
        Constructor
      • CircleShape

        public CircleShape​(double x,
                           double y,
                           double radius)
        Constructor
        Parameters:
        x - Center x
        y - Center y
        radius - Radius
    • Method Detail

      • getCenter

        public PointD getCenter​()
        Get circle center point
        Returns:
        Center point
      • getRadius

        public double getRadius​()
        Get radius
        Returns:
        Radius
      • contains

        public boolean contains​(Shape other)
        If this shape contains another one
        Overrides:
        contains in class Shape
        Parameters:
        other - Other shape
        Returns:
        Contains or not
      • contains

        public boolean contains​(PointD p)
        If this shape contains a point
        Parameters:
        p - Point
        Returns:
        Contains a point or not
      • clone

        public java.lang.Object clone​()
        Clone
        Overrides:
        clone in class PolygonShape
        Returns:
        CircleShape