Class DualQuadric

java.lang.Object
com.irurueta.geometry.BaseQuadric
com.irurueta.geometry.DualQuadric
All Implemented Interfaces:
Serializable

public class DualQuadric extends BaseQuadric implements Serializable
This class contains implementation of a dual quadric.
See Also:
  • Constructor Details

    • DualQuadric

      public DualQuadric()
      Constructor.
    • DualQuadric

      public DualQuadric(double a, double b, double c, double d, double e, double f, double g, double h, double i, double j)
      Constructor of this class. This constructor accepts every parameter describing a dual quadric (parameters a, b, c, d, e, f, g, h, i, j).
      Parameters:
      a - Parameter A of the quadric.
      b - Parameter B of the quadric.
      c - Parameter C of the quadric.
      d - Parameter D of the quadric.
      e - Parameter E of the quadric.
      f - Parameter F of the quadric.
      g - Parameter G of the quadric.
      h - Parameter H of the quadric.
      i - Parameter I of the quadric.
      j - Parameter J of the quadric.
    • DualQuadric

      public DualQuadric(com.irurueta.algebra.Matrix m) throws NonSymmetricMatrixException
      This method sets the matrix used to describe a dual quadric. This matrix must be 4x4 and symmetric.
      Parameters:
      m - 4x4 Matrix describing the quadric.
      Throws:
      IllegalArgumentException - Raised when the size of the matrix is not 4x4.
      NonSymmetricMatrixException - Raised when the quadric matrix is not symmetric.
    • DualQuadric

      public DualQuadric(Plane plane1, Plane plane2, Plane plane3, Plane plane4, Plane plane5, Plane plane6, Plane plane7, Plane plane8, Plane plane9) throws CoincidentPlanesException
      Creates a dual matrix where provided planes are its locus, or in other words, provided planes are tangent to the quadric corresponding to the created dual quadric.
      Parameters:
      plane1 - 1st plane.
      plane2 - 2nd plane.
      plane3 - 3rd plane.
      plane4 - 4th plane.
      plane5 - 5th plane.
      plane6 - 6th plane.
      plane7 - 7th plane.
      plane8 - 8th plane.
      plane9 - 9th plane.
      Throws:
      CoincidentPlanesException - if provided planes are in a configuration where more than one plane is coincident, creating a degeneracy.
  • Method Details

    • isLocus

      public boolean isLocus(Plane plane, double threshold)
      Checks if provided plane is locus of this dual quadric, or in other words, checks whether provided plane lies within this quadric, or whether provided plane is tangent to the quadric corresponding to this dual quadric.
      Parameters:
      plane - Plane to be tested.
      threshold - Threshold of tolerance to determine whether this plane is locus or not. This is needed because of limited machine precision. If threshold is not provided, then DEFAULT_LOCUS_THRESHOLD is used instead.
      Returns:
      True if provided plane is locus of this dual quadric, false otherwise.
      Throws:
      IllegalArgumentException - Raised if provided threshold is negative.
    • isLocus

      public boolean isLocus(Plane plane)
      Checks if provided plane is locus of this dual quadric, or in other words, checks whether provided plane lies within this quadric, or whether provided plane is tangent to the quadric corresponding to this dual quadric.
      Parameters:
      plane - Plane to be tested.
      Returns:
      True if provided plane is locus of this dual quadric, false otherwise.
      See Also:
    • angleBetweenPlanes

      public double angleBetweenPlanes(Plane planeA, Plane planeB)
      Computes the angle between two planes in radians.
      Parameters:
      planeA - First plane to be tested.
      planeB - Second plane to be tested.
      Returns:
      Angle between the two provided planes in radians. This angle is equal to the angle of their corresponding director vectors in an Euclidean geometry, but it might not be the case for the geometry defined by this dual quadric.
    • arePerpendicularPlanes

      public boolean arePerpendicularPlanes(Plane planeA, Plane planeB, double threshold)
      Checks if two planes are perpendicular attending to the geometry defined by this dual quadric, or in other words, if lA' * dualQ * lB is zero.
      Parameters:
      planeA - First plane to be checked.
      planeB - Second plane to be checked.
      threshold - Threshold of tolerance to determine whether the planes are perpendicular or not. This is needed because of limited machine precision. If threshold is not provided, then DEFAULT_PERPENDICULAR_THRESHOLD is used instead.
      Returns:
      True if provided planes are perpendicular, false otherwise.
      Throws:
      IllegalArgumentException - Raised if provided threshold is negative.
    • arePerpendicularPlanes

      public boolean arePerpendicularPlanes(Plane planeA, Plane planeB)
      Checks if two planes are perpendicular attending to the geometry defined by this dual quadric, or in other words, if lA' * dualQ * lB is zero.
      Parameters:
      planeA - First plane to be checked.
      planeB - Second plane to be checked.
      Returns:
      True if provided planes are perpendicular, false otherwise.
    • getQuadric

      public Quadric getQuadric() throws QuadricNotAvailableException
      Computes the quadric corresponding to this dual quadric.
      Returns:
      A new quadric instance of this dual quadric.
      Throws:
      QuadricNotAvailableException - Raised if the rank of the dual quadric matrix is not complete due to wrong parameters or numerical instability.
    • quadric

      public void quadric(Quadric quadric) throws QuadricNotAvailableException
      Computes the quadric corresponding to this dual quadric and stores the result in provided instance.
      Parameters:
      quadric - Quadric where result is stored.
      Throws:
      QuadricNotAvailableException - Raised if the rank of the dual quadric matrix is not complete due to wrong parameters or numerical instability.
    • setParametersFromPlanes

      public final void setParametersFromPlanes(Plane plane1, Plane plane2, Plane plane3, Plane plane4, Plane plane5, Plane plane6, Plane plane7, Plane plane8, Plane plane9) throws CoincidentPlanesException
      Sets parameters of this dual quadric so that provided planes lie within it (are locus).
      Parameters:
      plane1 - 1st plane.
      plane2 - 2nd plane.
      plane3 - 3rd plane.
      plane4 - 4th plane.
      plane5 - 5th plane.
      plane6 - 6th plane.
      plane7 - 7th plane.
      plane8 - 8th plane.
      plane9 - 9th plane.
      Throws:
      CoincidentPlanesException - Raised if planes are coincident or produce a degenerated configuration.
    • createCanonicalDualAbsoluteQuadric

      public static DualQuadric createCanonicalDualAbsoluteQuadric()
      Creates a canonical instance of the dual absolute quadric in the metric stratum. In an ideal metric stratum, in order to preserve orthogonality, the dual absolute quadric is defined as a degenerate dual quadric (i.e. cannot be inverted to obtain a quadric) containing the canonical dual absolute conic (i.e. the identity) in its top left sub-matrix
      Returns:
      a canonical instance of the dual absolute quadric