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- (float): size, not negativecenter- (Vector): origin, not null
-
Circle
public Circle(float radius) Creates a new circle.- Parameters:
radius- (float): size, not negative
-
-
Method Details
-
getRadius
public float getRadius()- Returns:
- (float): size of circle
-
getCenter
- Returns:
- (Vector): origin of circle, not null
-
getArea
public float getArea() -
getPerimeter
public float getPerimeter()- Specified by:
getPerimeterin classShape- Returns:
- shape perimeter
-
sample
Description copied from class:ShapeSample uniform point inside shape, including border. -
toPath
-