Circle
A class representing a circle shape. It implements the Shape interface and provides methods for geometric operations.
Methods
Circle(PointXY center, double radius)
Constructs a new Circle with a specified center point and radius.
getClosestPoint(PointXY reference)
Returns the point on the circle's perimeter that is closest to a given reference point. If the reference point is inside the circle, it returns the reference point itself.
isPointInShape(PointXY reference)
Checks if a given point is inside or on the perimeter of the circle.
doesCollideWith(Shape<?> shape)
Determines if this circle collides with another shape.
getCenter()
Returns the center point of the circle.
getRadius()
Returns the radius of the circle.
rotate(Angle rotation)
Rotates the circle around its own center by a given angle.
rotate(Angle rotation, PointXY centerOfRotation)
Rotates the circle around a specified center of rotation by a given angle.
shift(double shiftX, double shiftY)
Translates the circle by given x and y offsets.
moveTo(PointXY newCenter)
Moves the circle to a new center point, keeping its radius the same.
scale(double scale)
Scales the circle's radius by a given factor, keeping the center the same.
growBy(double growth)
Increases the circle's radius by a given amount.