Class BaseQuadric

java.lang.Object
com.irurueta.geometry.BaseQuadric
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DualQuadric, Quadric

public abstract class BaseQuadric extends Object implements Serializable
Class defining the base interface of any possible quadric. Appropriate subclasses should be used for each quadric type: pure quadrics and dual quadrics.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private double
    A element of the matrix defining a quadric.
    private double
    B element of the matrix defining a quadric.
    static final int
    Number of columns of one matrix that contains quadric parameters.
    static final int
    Number of rows of one matrix that contains quadric parameters.
    private double
    C element of the matrix defining a quadric.
    private double
    D element of the matrix defining a quadric.
    static final double
    Threshold above zero to determine whether a point lies inside (is locus of) the given quadric or not.
    static final double
    Threshold above zero to determine whether two points of a quadric are perpendicular or not.
    private static final double
    Threshold above zero to determine whether one matrix is symmetric or not.
    private double
    E element of the matrix defining a quadric.
    private double
    F element of the matrix defining a quadric.
    private double
    G element of the matrix defining a quadric.
    private double
    H element of the matrix defining a quadric.
    private double
    I element of the matrix defining a quadric.
    private double
    J element of the matrix defining a quadric.
    static final double
    Minimum allowed threshold.
    static final int
    Number of parameters on a quadric or dual quadric.
    private boolean
    Determines whether this instance is already normalized.
    private static final double
    Machine precision.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor of this class.
    protected
    BaseQuadric(double a, double b, double c, double d, double e, double f, double g, double h, double i, double j)
    Constructor of this class.
    protected
    BaseQuadric(com.irurueta.algebra.Matrix m)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.irurueta.algebra.Matrix
    Returns the matrix that describes this base quadric.
    void
    asMatrix(com.irurueta.algebra.Matrix m)
    Sets the values in provided matrix corresponding to this base quadric.
    double
    Returns parameter A of the given base quadric.
    double
    Returns parameter B of the given base quadric.
    double
    Returns parameter C of the given base quadric.
    double
    Returns parameter D of the given base quadric.
    double
    Returns parameter E of the given base quadric.
    double
    Returns parameter F of the given base quadric.
    double
    Returns parameter G of the given base quadric.
    double
    Returns parameter H of the given base quadric.
    double
    Returns parameter I of the given base quadric.
    double
    Returns parameter J of the given base quadric.
    boolean
    Returns boolean indicating whether this base quadric has already been normalized.
    void
    Normalizes the Quadric params using its norm.
    void
    setA(double a)
    This method sets the A parameter of a base quadric.
    void
    setB(double b)
    This method sets the B parameter of a base quadric.
    void
    setC(double c)
    This method sets the C parameter of a base quadric.
    void
    setD(double d)
    This method sets the D parameter of a base quadric.
    void
    setE(double e)
    This method sets the E parameter of a base quadric.
    void
    setF(double f)
    This method sets the F parameter of a base quadric.
    void
    setG(double g)
    This method sets the G parameter of a base quadric.
    void
    setH(double h)
    This method sets the H parameter of a base quadric.
    void
    setI(double i)
    This method sets the "I" parameter of a base quadric.
    void
    setJ(double j)
    This method sets the J parameter of a base quadric.
    final void
    setParameters(double a, double b, double c, double d, double e, double f, double g, double h, double i, double j)
    This method accepts every parameter describing a base quadric (parameters a, b, c, d, e, f, g, h, i,, j).
    final void
    setParameters(com.irurueta.algebra.Matrix m)
    This method sets the matrix used for describing a base quadric.
    final void
    setParameters(com.irurueta.algebra.Matrix m, double symmetricThreshold)
    This method sets the matrix used for describing a base quadric.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BASEQUADRIC_MATRIX_ROW_SIZE

      public static final int BASEQUADRIC_MATRIX_ROW_SIZE
      Number of rows of one matrix that contains quadric parameters.
      See Also:
    • BASEQUADRIC_MATRIX_COLUMN_SIZE

      public static final int BASEQUADRIC_MATRIX_COLUMN_SIZE
      Number of columns of one matrix that contains quadric parameters.
      See Also:
    • N_PARAMS

      public static final int N_PARAMS
      Number of parameters on a quadric or dual quadric.
      See Also:
    • DEFAULT_LOCUS_THRESHOLD

      public static final double DEFAULT_LOCUS_THRESHOLD
      Threshold above zero to determine whether a point lies inside (is locus of) the given quadric or not.
      See Also:
    • DEFAULT_PERPENDICULAR_THRESHOLD

      public static final double DEFAULT_PERPENDICULAR_THRESHOLD
      Threshold above zero to determine whether two points of a quadric are perpendicular or not.
      See Also:
    • MIN_THRESHOLD

      public static final double MIN_THRESHOLD
      Minimum allowed threshold.
      See Also:
    • DEFAULT_SYMMETRIC_THRESHOLD

      private static final double DEFAULT_SYMMETRIC_THRESHOLD
      Threshold above zero to determine whether one matrix is symmetric or not.
      See Also:
    • PRECISION

      private static final double PRECISION
      Machine precision.
      See Also:
    • a

      private double a
      A element of the matrix defining a quadric.
    • b

      private double b
      B element of the matrix defining a quadric.
    • c

      private double c
      C element of the matrix defining a quadric.
    • d

      private double d
      D element of the matrix defining a quadric.
    • e

      private double e
      E element of the matrix defining a quadric.
    • f

      private double f
      F element of the matrix defining a quadric.
    • g

      private double g
      G element of the matrix defining a quadric.
    • h

      private double h
      H element of the matrix defining a quadric.
    • i

      private double i
      I element of the matrix defining a quadric.
    • j

      private double j
      J element of the matrix defining a quadric.
    • normalized

      private boolean normalized
      Determines whether this instance is already normalized.
  • Constructor Details

    • BaseQuadric

      protected BaseQuadric()
      Constructor of this class.
    • BaseQuadric

      protected BaseQuadric(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 base quadric (parameters a, b, c, d, e, f, g, h, i).
      Parameters:
      a - Parameter A of the base quadric.
      b - Parameter B of the base quadric.
      c - Parameter C of the base quadric.
      d - Parameter D of the base quadric.
      e - Parameter E of the base quadric.
      f - Parameter F of the base quadric.
      g - Parameter G of the base quadric.
      h - Parameter H of the base quadric.
      i - Parameter I of the base quadric.
      j - Parameter J of the base quadric.
    • BaseQuadric

      protected BaseQuadric(com.irurueta.algebra.Matrix m) throws NonSymmetricMatrixException
      Constructor. This constructor accepts a Matrix describing a base quadric.
      Parameters:
      m - 4x4 matrix describing a base quadric.
      Throws:
      NonSymmetricMatrixException - Raised when the quadric matrix is not symmetric.
      IllegalArgumentException - Raised when the size of the matrix is not 4x4.
  • Method Details

    • getA

      public double getA()
      Returns parameter A of the given base quadric.
      Returns:
      Parameter B of a matrix describing a base quadric.
    • getB

      public double getB()
      Returns parameter B of the given base quadric.
      Returns:
      Parameter B of a matrix describing a base quadric.
    • getC

      public double getC()
      Returns parameter C of the given base quadric.
      Returns:
      Parameter C of a matrix describing a base quadric.
    • getD

      public double getD()
      Returns parameter D of the given base quadric.
      Returns:
      Parameter D of a matrix describing a base quadric.
    • getE

      public double getE()
      Returns parameter E of the given base quadric.
      Returns:
      Parameter E of a matrix describing a base quadric.
    • getF

      public double getF()
      Returns parameter F of the given base quadric.
      Returns:
      Parameter F of a matrix describing a base quadric.
    • getG

      public double getG()
      Returns parameter G of the given base quadric.
      Returns:
      Parameter G of a matrix describing a base quadric.
    • getH

      public double getH()
      Returns parameter H of the given base quadric.
      Returns:
      Parameter H of a matrix describing a base quadric.
    • getI

      public double getI()
      Returns parameter I of the given base quadric.
      Returns:
      Parameter I of a matrix describing a base quadric.
    • getJ

      public double getJ()
      Returns parameter J of the given base quadric.
      Returns:
      Parameter J of a matrix describing a base quadric.
    • setParameters

      public final void setParameters(double a, double b, double c, double d, double e, double f, double g, double h, double i, double j)
      This method accepts every parameter describing a base quadric (parameters a, b, c, d, e, f, g, h, i,, j).
      Parameters:
      a - Parameter A of the base quadric.
      b - Parameter B of the base quadric.
      c - Parameter C of the base quadric.
      d - Parameter D of the base quadric.
      e - Parameter E of the base quadric.
      f - Parameter F of the base quadric.
      g - Parameter G of the base quadric.
      h - Parameter H of the base quadric.
      i - Parameter I of the base quadric.
      j - Parameter J of the base quadric.
    • setParameters

      public final void setParameters(com.irurueta.algebra.Matrix m, double symmetricThreshold) throws NonSymmetricMatrixException
      This method sets the matrix used for describing a base quadric. This matrix must be 4x4 and symmetric.
      Parameters:
      m - 4x4 Matrix describing a base quadric.
      symmetricThreshold - Grade of tolerance to determine whether a matrix is symmetric or not. It is used because due to machine precision a matrix might not be considered exactly symmetric (by default: DEFAULT_SYMMETRIC_THRESHOLD is used).
      Throws:
      IllegalArgumentException - Raised when the size of the matrix is not 4x4.
      NonSymmetricMatrixException - Raised when the quadric matrix is not symmetric.
    • setParameters

      public final void setParameters(com.irurueta.algebra.Matrix m) throws NonSymmetricMatrixException
      This method sets the matrix used for describing a base quadric. This matrix must be 4x4 and symmetric.
      Parameters:
      m - 4x4 matrix describing a base quadric.
      Throws:
      IllegalArgumentException - Raised when the size of the matrix is not 4x4.
      NonSymmetricMatrixException - Raised when the quadric matrix is not symmetric.
    • setA

      public void setA(double a)
      This method sets the A parameter of a base quadric.
      Parameters:
      a - Parameter A of the given base quadric.
    • setB

      public void setB(double b)
      This method sets the B parameter of a base quadric.
      Parameters:
      b - Parameter B of the given base quadric.
    • setC

      public void setC(double c)
      This method sets the C parameter of a base quadric.
      Parameters:
      c - Parameter C of the given base quadric.
    • setD

      public void setD(double d)
      This method sets the D parameter of a base quadric.
      Parameters:
      d - Parameter D of the given base quadric.
    • setE

      public void setE(double e)
      This method sets the E parameter of a base quadric.
      Parameters:
      e - Parameter E of the given base quadric.
    • setF

      public void setF(double f)
      This method sets the F parameter of a base quadric.
      Parameters:
      f - Parameter F of the given base quadric.
    • setG

      public void setG(double g)
      This method sets the G parameter of a base quadric.
      Parameters:
      g - Parameter G of the given base quadric.
    • setH

      public void setH(double h)
      This method sets the H parameter of a base quadric.
      Parameters:
      h - Parameter H of the given base quadric.
    • setI

      public void setI(double i)
      This method sets the "I" parameter of a base quadric.
      Parameters:
      i - Parameter "I" of the given base quadric.
    • setJ

      public void setJ(double j)
      This method sets the J parameter of a base quadric.
      Parameters:
      j - Parameter J of the given base quadric.
    • asMatrix

      public com.irurueta.algebra.Matrix asMatrix()
      Returns the matrix that describes this base quadric.
      Returns:
      4x4 matrix describing this base quadric.
    • asMatrix

      public void asMatrix(com.irurueta.algebra.Matrix m)
      Sets the values in provided matrix corresponding to this base quadric.
      Parameters:
      m - Provided matrix where values will be stored.
      Throws:
      IllegalArgumentException - Raised if provided matrix is not 4x4.
    • normalize

      public void normalize()
      Normalizes the Quadric params using its norm.
    • isNormalized

      public boolean isNormalized()
      Returns boolean indicating whether this base quadric has already been normalized.
      Returns:
      True if normalized, false otherwise.