Package ch.epfl.cs107.play.math.shape
Class Shape
java.lang.Object
ch.epfl.cs107.play.math.shape.Shape
Base class of all physical shapes.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Shape
public Shape()
-
-
Method Details
-
getArea
public abstract float getArea()- Returns:
- shape area
-
getPerimeter
public abstract float getPerimeter()- Returns:
- shape perimeter
-
sample
Sample uniform point inside shape, including border.- Returns:
- (Vector): a uniform sample, not null
-
toPath
- Returns:
- (Path2D): AWT path used for drawing
-