Package com.irurueta.geometry
Class BaseConic
java.lang.Object
com.irurueta.geometry.BaseConic
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprotected double"A" element of the matrix defining a conic.protected doubleB element of the matrix defining a conic.static final intNumber of columns of one matrix that contains conic parameters.static final intNumber of rows of one matrix that contains conic parameters.protected doubleC element of the matrix defining a conic.private doubleD element of the matrix defining a conic.static final doubleThreshold above zero used to determine whether a point lies inside (is locus of) the given conic or not.static final doubleThreshold above zero used to determine whether two points of a conic are perpendicular or not.private static final doubleThreshold above zero to determine whether one matrix is symmetric or not.private doubleE element of the matrix defining a conic.private doubleF element of the matrix defining a conic.static final doubleMinimum allowed threshold.static final intNumber of parameters on a conic or dual conic.private booleanDetermines whether this instance is already mNormalized.private static final doubleMachine precision. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.irurueta.algebra.MatrixasMatrix()Returns the matrix that describes this base conic.voidasMatrix(com.irurueta.algebra.Matrix m) Sets the values in provided matrix corresponding to this base conic.doublegetA()Returns parameter A of the given base conic.doublegetB()Returns parameter B of the given base conic.doublegetC()Returns parameter C of the given base conic.doublegetD()Returns parameter D of the given base conic.doublegetE()Returns parameter E of the given base conic.doublegetF()Returns parameter F of the given base conic.booleanReturns boolean indicating whether this base conic has already been normalized.voidNormalizes the Conic params using its normvoidsetA(double a) This method sets the A parameter of a base conic.voidsetB(double b) This method sets the B parameter of a base conic.voidsetC(double c) This method sets the C parameter of a base conic.voidsetD(double d) This method sets the D parameter of a base conic.voidsetE(double e) This method sets the E parameter of a base conic.voidsetF(double f) This method sets the F parameter of a base conic.final voidsetParameters(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 voidsetParameters(com.irurueta.algebra.Matrix m) This method sets the matrix used for describing a base conic.final voidsetParameters(com.irurueta.algebra.Matrix m, double symmetricThreshold) This method sets the matrix used for describing a base conic.
-
Field Details
-
BASECONIC_MATRIX_ROW_SIZE
public static final int BASECONIC_MATRIX_ROW_SIZENumber of rows of one matrix that contains conic parameters.- See Also:
-
BASECONIC_MATRIX_COLUMN_SIZE
public static final int BASECONIC_MATRIX_COLUMN_SIZENumber of columns of one matrix that contains conic parameters.- See Also:
-
N_PARAMS
public static final int N_PARAMSNumber of parameters on a conic or dual conic.- See Also:
-
DEFAULT_LOCUS_THRESHOLD
public static final double DEFAULT_LOCUS_THRESHOLDThreshold 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_THRESHOLDThreshold above zero used to determine whether two points of a conic are perpendicular or not.- See Also:
-
MIN_THRESHOLD
public static final double MIN_THRESHOLDMinimum allowed threshold.- See Also:
-
DEFAULT_SYMMETRIC_THRESHOLD
private static final double DEFAULT_SYMMETRIC_THRESHOLDThreshold above zero to determine whether one matrix is symmetric or not.- See Also:
-
PRECISION
private static final double PRECISIONMachine precision.- See Also:
-
a
protected double a"A" element of the matrix defining a conic. -
b
protected double bB element of the matrix defining a conic. -
c
protected double cC element of the matrix defining a conic. -
d
private double dD element of the matrix defining a conic. -
e
private double eE element of the matrix defining a conic. -
f
private double fF element of the matrix defining a conic. -
normalized
private boolean normalizedDetermines 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 conicb- 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
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
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.
-