-
- All Implemented Interfaces:
-
java.io.Serializable
public interface GeometricShape<S extends Vector<S>, A extends GeometricTransformation<S>> implements Serializable
Models a generic shape.
-
-
Method Summary
Modifier and Type Method Description abstract Booleanintersects(GeometricShape<S, A> other)A shape intersects another if any of its points is contained in the other one. abstract Booleancontains(S vector)Check if the shape contains a vector. abstract GeometricShape<S, A>transformed(Function1<A, Unit> transformation)Transforms the shape. abstract DoublegetDiameter()The largest distance between any pair of vertices. DoublegetRadius()abstract SgetCentroid()The geometric center. -
-
Method Detail
-
intersects
abstract Boolean intersects(GeometricShape<S, A> other)
A shape intersects another if any of its points is contained in the other one.
- Parameters:
other- the other shape
-
contains
abstract Boolean contains(S vector)
Check if the shape contains a vector.
- Parameters:
vector- the position vector
-
transformed
abstract GeometricShape<S, A> transformed(Function1<A, Unit> transformation)
Transforms the shape.
- Parameters:
transformation- describes the transformations to apply to the shape
-
getDiameter
abstract Double getDiameter()
The largest distance between any pair of vertices.
-
getCentroid
abstract S getCentroid()
The geometric center.
-
-
-
-