Class BaseConic

java.lang.Object
com.irurueta.geometry.BaseConic
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Conic, DualConic

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

    Fields
    Modifier and Type
    Field
    Description
    protected double
    "A" element of the matrix defining a conic.
    protected double
    B element of the matrix defining a conic.
    static final int
    Number of columns of one matrix that contains conic parameters.
    static final int
    Number of rows of one matrix that contains conic parameters.
    protected double
    C element of the matrix defining a conic.
    private double
    D element of the matrix defining a conic.
    static final double
    Threshold above zero used to determine whether a point lies inside (is locus of) the given conic or not.
    static final double
    Threshold above zero used to determine whether two points of a conic 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 conic.
    private double
    F element of the matrix defining a conic.
    static final double
    Minimum allowed threshold.
    static final int
    Number of parameters on a conic or dual conic.
    private boolean
    Determines whether this instance is already mNormalized.
    private static final double
    Machine precision.
  • Constructor Summary

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

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

    Methods inherited from class java.lang.Object

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

    • BASECONIC_MATRIX_ROW_SIZE

      public static final int BASECONIC_MATRIX_ROW_SIZE
      Number of rows of one matrix that contains conic parameters.
      See Also:
    • BASECONIC_MATRIX_COLUMN_SIZE

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

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

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

      public static final double DEFAULT_PERPENDICULAR_THRESHOLD
      Threshold above zero used to determine whether two points of a conic 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

      protected double a
      "A" element of the matrix defining a conic.
    • b

      protected double b
      B element of the matrix defining a conic.
    • c

      protected double c
      C element of the matrix defining a conic.
    • d

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

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

      private double f
      F element of the matrix defining a conic.
    • normalized

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

    • BaseConic

      protected BaseConic()
      Constructor of this class.
    • BaseConic

      protected BaseConic(double a, double b, double c, double d, double e, double f)
      Constructor of this class. This constructor accepts every parameter describing a base conic (parameters a, b, c, d, e, f).
      Parameters:
      a - Parameter A of the base conic
      b - Parameter B of the base conic.
      c - Parameter C of the base conic.
      d - Parameter D of the base conic.
      e - Parameter E of the base conic.
      f - Parameter F of the base conic.
    • BaseConic

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

    • getA

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

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

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

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

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

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

      public final void setParameters(double a, double b, double c, double d, double e, double f)
      This method accepts every parameter describing a base conic (parameters a, b, c, d, e, f).
      Parameters:
      a - Parameter A of the base conic.
      b - Parameter B of the base conic.
      c - Parameter C of the base conic.
      d - Parameter D of the base conic.
      e - Parameter E of the base conic.
      f - Parameter F of the base conic.
    • setParameters

      public final void setParameters(com.irurueta.algebra.Matrix m, double symmetricThreshold) throws NonSymmetricMatrixException
      This method sets the matrix used for describing a base conic. This matrix must be 3x3 and symmetric.
      Parameters:
      m - 3x3 Matrix describing a base conic.
      symmetricThreshold - Grade of tolerance to determine whether a matrix is symmetric or not. Because of machine precision, the values may not be exactly equal. (by default: DEFAULT_SYMMETRIC_THRESHOLD is used).
      Throws:
      IllegalArgumentException - Raised when the size of the matrix is not 3x3.
      NonSymmetricMatrixException - Raised when the conic 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 conic. This matrix must be 3x3 and symmetric.
      Parameters:
      m - 3x3 Matrix describing a base conic.
      Throws:
      IllegalArgumentException - Raised when the size of the matrix is not 3x3.
      NonSymmetricMatrixException - Raised when the conic matrix is not symmetric.
    • setA

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

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

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

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

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

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

      public com.irurueta.algebra.Matrix asMatrix()
      Returns the matrix that describes this base conic.
      Returns:
      3x3 matrix describing this base conic.
    • asMatrix

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

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

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