Interface Shape

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Boolean intersects(Shape<S, A> other) A shape intersects another if any of its points is contained in the other one.
      abstract Boolean contains(S vector) Check if the shape contains a vector.
      abstract Shape<S, A> transformed(Function1<A, Unit> transformation) Transforms the shape.
      abstract Double getDiameter() The largest distance between any pair of vertices.
      Double getRadius()
      abstract S getCentroid() The geometric center.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • intersects

         abstract Boolean intersects(Shape<S, A> other)

        A shape intersects another if any of its points is contained in the other one.

        Parameters:
        other - the other shape
        Returns:

        true if the intersection is not empty

      • contains

         abstract Boolean contains(S vector)

        Check if the shape contains a vector.

        Parameters:
        vector - the position vector
        Returns:

        true if the vector is contained in the shape

      • transformed

         abstract Shape<S, A> transformed(Function1<A, Unit> transformation)

        Transforms the shape.

        Parameters:
        transformation - describes the transformations to apply to the shape
        Returns:

        a copy of the shape transformed accordingly

      • getDiameter

         abstract Double getDiameter()

        The largest distance between any pair of vertices.

      • getCentroid

         abstract S getCentroid()

        The geometric center.