类 CircleShape

  • 所有已实现的接口:
    java.lang.Cloneable

    public class CircleShape
    extends PolygonShape
    Circle shape class
    作者:
    Yaqiang Wang
    • 构造器详细资料

      • CircleShape

        public CircleShape()
        Constructor
      • CircleShape

        public CircleShape​(double x,
                           double y,
                           double radius)
        Constructor
        参数:
        x - Center x
        y - Center y
        radius - Radius
    • 方法详细资料

      • getCenter

        public PointD getCenter()
        Get circle center point
        返回:
        Center point
      • getRadius

        public double getRadius()
        Get radius
        返回:
        Radius
      • contains

        public boolean contains​(Shape other)
        If this shape contains another one
        覆盖:
        contains 在类中 Shape
        参数:
        other - Other shape
        返回:
        Contains or not
      • contains

        public boolean contains​(PointD p)
        If this shape contains a point
        参数:
        p - Point
        返回:
        Contains a point or not
      • clone

        public java.lang.Object clone()
        Clone
        覆盖:
        clone 在类中 PolygonShape
        返回:
        CircleShape