Interface Plane

All Known Subinterfaces:
MPlane

public interface Plane
Interface for handling planes in 3d. A plane is a flat, two-dimensional surface that extends infinitely far. Plane is defined by a point on the plane and the planes normal vector.
Since:
9.10.2
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(Vector3d point, double tolerance)
    Checks if the distance of the given point for this plane is less than the given tolerance.
    static Plane
    create(Vector3d pointOnPlane, Vector3d planeNormal)
    Returns the plane defined by the given points.
    double
    Calculates the dihedral angle between this plane and the given plane.
    double
    Calculates the distance of this plane from the given point.
    double
    Calculates the distance of this plane from the given point squared.
    Returns the normal of the plane.
    Returns a point on the plane used to define the plane.
    Calculates the intersection between this plane and the given plane and returns the resulting line.
    Projects the given point onto this plane performing an orthogonal projection.
    project(Vector3d point, Vector3d direction)
    Projects the given point onto this plane in the direction of the given direction vector.
    double
    Calculates the signed distance of this plane from the given point.
    signedDistance(Vector3d point, Vector3d direction)
    Calculates the signed distance of this plane from the given point with some direction vector.
  • Method Details

    • create

      static Plane create(Vector3d pointOnPlane, Vector3d planeNormal)
      Returns the plane defined by the given points.
      Parameters:
      pointOnPlane - an arbitrary point on the plane
      planeNormal - the normal of the plane
      Returns:
      the plane defined by the given points
      Since:
      9.10.2
    • getPoint

      Vector3d getPoint()
      Returns a point on the plane used to define the plane.
      Returns:
      the plane point
      Since:
      9.10.2
    • getNormal

      Vector3d getNormal()
      Returns the normal of the plane. The vector is of unit length.
      Returns:
      the normal of the plane
      Since:
      9.10.2
    • distanceSquared

      double distanceSquared(Vector3d point)
      Calculates the distance of this plane from the given point squared.
      Parameters:
      point - the point
      Returns:
      the distance squared
      Since:
      9.10.2
    • distance

      double distance(Vector3d point)
      Calculates the distance of this plane from the given point.
      Parameters:
      point - the point
      Returns:
      the distance
      Since:
      9.10.2
    • signedDistance

      double signedDistance(Vector3d point)
      Calculates the signed distance of this plane from the given point. The sign tells which side of the plane the given point is on. If the sign is positive, the point is on the side that the normal vector is pointing towards, otherwise the point is on the "backside" on the plane.
      Parameters:
      point - the point
      Returns:
      the distance
      Since:
      9.10.2
    • signedDistance

      Optional<Double> signedDistance(Vector3d point, Vector3d direction)
      Calculates the signed distance of this plane from the given point with some direction vector. If the sign is positive, to get from the point to the plane, the travel goes to the positive direction according to the direction vector, otherwise the negative direction. The sign tells which side of the plane the given point is on. If the direction vector would never reach the plane, the resulting Optional is empty.
      Parameters:
      point - the point
      direction - the direction
      Returns:
      the distance
      Since:
      9.10.2
    • contains

      boolean contains(Vector3d point, double tolerance)
      Checks if the distance of the given point for this plane is less than the given tolerance. This can be used to test if a point is on the plane by making epsilon zero or reasonably small.
      Parameters:
      point - the point
      tolerance - the tolerance
      Returns:
      true if the given point is on the plane, false otherwise
      Since:
      9.10.2
    • project

      MVector3d project(Vector3d point)
      Projects the given point onto this plane performing an orthogonal projection.
      Parameters:
      point - the point
      Returns:
      the projected point
      Since:
      9.10.2
    • project

      Optional<MVector3d> project(Vector3d point, Vector3d direction)
      Projects the given point onto this plane in the direction of the given direction vector. If the direction vector makes it impossible to project the point, an empty Optional is returned.
      Parameters:
      point - the point that is project onto this plane
      direction - the direction of the projecting
      Returns:
      the projected point
      Since:
      9.10.2
    • intersect

      Optional<MLine3d> intersect(Plane plane)
      Calculates the intersection between this plane and the given plane and returns the resulting line. If the planes do not intersect or are equal, the resulting Optional will be empty.
      Parameters:
      plane - the other plane
      Returns:
      the resulting line
      Since:
      9.10.2
    • dihedralAngle

      double dihedralAngle(Plane plane)
      Calculates the dihedral angle between this plane and the given plane.
      Parameters:
      plane - the other plane
      Returns:
      the dihedral angle as a double
      Since:
      9.10.2