Package ch.epfl.cs107.play.math.shape
Class Circle
java.lang.Object
ch.epfl.cs107.play.math.shape.Shape
ch.epfl.cs107.play.math.shape.Circle
Represents an immutable circle.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Circle
Creates a new circle.- Parameters:
radius- (double): size, not negativecenter- (Vector): origin, not null
-
Circle
public Circle(double radius) Creates a new circle.- Parameters:
radius- (double): size, not negative
-
-
Method Details
-
getRadius
public double getRadius()- Returns:
- (double): size of circle
-
getCenter
- Returns:
- (Vector): origin of circle, not null
-
getArea
public double getArea() -
getPerimeter
public double getPerimeter()- Specified by:
getPerimeterin classShape- Returns:
- shape perimeter
-
sample
Description copied from class:ShapeSample uniform point inside shape, including border. -
toPath
-