Package com.irurueta.geometry
Class BaseQuadric
java.lang.Object
com.irurueta.geometry.BaseQuadric
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DualQuadric,Quadric
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
FieldsModifier and TypeFieldDescriptionprivate doubleA element of the matrix defining a quadric.private doubleB element of the matrix defining a quadric.static final intNumber of columns of one matrix that contains quadric parameters.static final intNumber of rows of one matrix that contains quadric parameters.private doubleC element of the matrix defining a quadric.private doubleD element of the matrix defining a quadric.static final doubleThreshold above zero to determine whether a point lies inside (is locus of) the given quadric or not.static final doubleThreshold above zero to determine whether two points of a quadric 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 quadric.private doubleF element of the matrix defining a quadric.private doubleG element of the matrix defining a quadric.private doubleH element of the matrix defining a quadric.private doubleI element of the matrix defining a quadric.private doubleJ element of the matrix defining a quadric.static final doubleMinimum allowed threshold.static final intNumber of parameters on a quadric or dual quadric.private booleanDetermines whether this instance is already normalized.private static final doubleMachine precision. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor of this class.protectedBaseQuadric(double a, double b, double c, double d, double e, double f, double g, double h, double i, double j) Constructor of this class.protectedBaseQuadric(com.irurueta.algebra.Matrix m) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.irurueta.algebra.MatrixasMatrix()Returns the matrix that describes this base quadric.voidasMatrix(com.irurueta.algebra.Matrix m) Sets the values in provided matrix corresponding to this base quadric.doublegetA()Returns parameter A of the given base quadric.doublegetB()Returns parameter B of the given base quadric.doublegetC()Returns parameter C of the given base quadric.doublegetD()Returns parameter D of the given base quadric.doublegetE()Returns parameter E of the given base quadric.doublegetF()Returns parameter F of the given base quadric.doublegetG()Returns parameter G of the given base quadric.doublegetH()Returns parameter H of the given base quadric.doublegetI()Returns parameter I of the given base quadric.doublegetJ()Returns parameter J of the given base quadric.booleanReturns boolean indicating whether this base quadric has already been normalized.voidNormalizes the Quadric params using its norm.voidsetA(double a) This method sets the A parameter of a base quadric.voidsetB(double b) This method sets the B parameter of a base quadric.voidsetC(double c) This method sets the C parameter of a base quadric.voidsetD(double d) This method sets the D parameter of a base quadric.voidsetE(double e) This method sets the E parameter of a base quadric.voidsetF(double f) This method sets the F parameter of a base quadric.voidsetG(double g) This method sets the G parameter of a base quadric.voidsetH(double h) This method sets the H parameter of a base quadric.voidsetI(double i) This method sets the "I" parameter of a base quadric.voidsetJ(double j) This method sets the J parameter of a base quadric.final voidsetParameters(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 voidsetParameters(com.irurueta.algebra.Matrix m) This method sets the matrix used for describing a base quadric.final voidsetParameters(com.irurueta.algebra.Matrix m, double symmetricThreshold) This method sets the matrix used for describing a base quadric.
-
Field Details
-
BASEQUADRIC_MATRIX_ROW_SIZE
public static final int BASEQUADRIC_MATRIX_ROW_SIZENumber of rows of one matrix that contains quadric parameters.- See Also:
-
BASEQUADRIC_MATRIX_COLUMN_SIZE
public static final int BASEQUADRIC_MATRIX_COLUMN_SIZENumber of columns of one matrix that contains quadric parameters.- See Also:
-
N_PARAMS
public static final int N_PARAMSNumber of parameters on a quadric or dual quadric.- See Also:
-
DEFAULT_LOCUS_THRESHOLD
public static final double DEFAULT_LOCUS_THRESHOLDThreshold 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_THRESHOLDThreshold above zero to determine whether two points of a quadric 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
private double aA element of the matrix defining a quadric. -
b
private double bB element of the matrix defining a quadric. -
c
private double cC element of the matrix defining a quadric. -
d
private double dD element of the matrix defining a quadric. -
e
private double eE element of the matrix defining a quadric. -
f
private double fF element of the matrix defining a quadric. -
g
private double gG element of the matrix defining a quadric. -
h
private double hH element of the matrix defining a quadric. -
i
private double iI element of the matrix defining a quadric. -
j
private double jJ element of the matrix defining a quadric. -
normalized
private boolean normalizedDetermines 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
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
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.
-