Package com.irurueta.geometry
Class AffineParameters3D
java.lang.Object
com.irurueta.geometry.AffineParameters3D
- All Implemented Interfaces:
Serializable
This class defines additional parameters that can be defined on affine
3D transformations.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault scale value having no effect on transformations.static final doubleDefault skewness value having no effect on transformations.private static final doubleDefault threshold to determine whether a matrix is a valid 3x3 upper triangular one.static final intNumber of inhomogeneous coordinates in 3D space.private doubleScale on x coordinates.private doubleScale on y coordinates.private doubleScale on z coordinates.private doubleSkewness factor between axes x-y.private doubleSkewness factor between axes x-z.private doubleSkewness factor between axes y-z. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.AffineParameters3D(double scale) Constructor with scale.AffineParameters3D(double scale, double skewness) Constructor with scale and skewness.AffineParameters3D(double scaleX, double scaleY, double scaleZ, double skewnessXY, double skewnessXZ, double skewnessYZ) Constructor with scale and skewness on each axis.AffineParameters3D(com.irurueta.algebra.Matrix m) Constructor with matrix.AffineParameters3D(com.irurueta.algebra.Matrix m, double threshold) Constructor with matrix and threshold. -
Method Summary
Modifier and TypeMethodDescriptioncom.irurueta.algebra.MatrixasMatrix()Converts this affine parameters instance into matrix representationvoidasMatrix(com.irurueta.algebra.Matrix m) Converts this affine parameters instance into matrix representation and stores the result into provided matrix.final voidfromMatrix(com.irurueta.algebra.Matrix m) Sets parameters of this instance from provided matrix.final voidfromMatrix(com.irurueta.algebra.Matrix m, double threshold) Sets parameters of this instance from provided matrix.doubleReturns scale for x-axis.doubleReturns scale for y-axis.doubleReturns scale for z axis.doubleReturns skewness value for x-y axes.doubleReturns skewness value for x-z axes.doubleReturns skewness value for y-z axes.static booleanisValidMatrix(com.irurueta.algebra.Matrix m) Returns boolean indicating whether provided matrix is a valid matrix to set affine parameters from.static booleanisValidMatrix(com.irurueta.algebra.Matrix m, double threshold) Returns boolean indicating whether provided matrix is a valid matrix to set affine parameters form.voidsetScale(double scale) Sets overall scale (for x, y and z axes).voidsetScaleX(double scaleX) Sets scale for x-axis.voidsetScaleY(double scaleY) Sets scale for y-axis.voidsetScaleZ(double scaleZ) Sets scale for z axis.voidsetSkewnessXY(double skewnessXY) Sets skewness value for x-y axes.voidsetSkewnessXZ(double skewnessXZ) Sets skewness value for x-z axes.voidsetSkewnessYZ(double skewnessYZ) Sets skewness value for y-z axes.
-
Field Details
-
DEFAULT_SCALE
public static final double DEFAULT_SCALEDefault scale value having no effect on transformations.- See Also:
-
DEFAULT_SKEWNESS
public static final double DEFAULT_SKEWNESSDefault skewness value having no effect on transformations.- See Also:
-
INHOM_COORDS
public static final int INHOM_COORDSNumber of inhomogeneous coordinates in 3D space.- See Also:
-
DEFAULT_VALID_THRESHOLD
private static final double DEFAULT_VALID_THRESHOLDDefault threshold to determine whether a matrix is a valid 3x3 upper triangular one.- See Also:
-
scaleX
private double scaleXScale on x coordinates. -
scaleY
private double scaleYScale on y coordinates. -
scaleZ
private double scaleZScale on z coordinates. -
skewnessXY
private double skewnessXYSkewness factor between axes x-y. If 0.0, x and y axes remain orthogonal, otherwise they get slanted. -
skewnessXZ
private double skewnessXZSkewness factor between axes x-z. If 0.0, x and z axes remain orthogonal, otherwise they get slanted. -
skewnessYZ
private double skewnessYZSkewness factor between axes y-z. If 0.0, y and z axes remain orthogonal, otherwise they get slanted.
-
-
Constructor Details
-
AffineParameters3D
public AffineParameters3D()Constructor. Sets default scale and skewness. -
AffineParameters3D
public AffineParameters3D(double scale) Constructor with scale. Sets default skewness and provided scale.- Parameters:
scale- Scale to be set (in x, y and z axes). A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects size, and negative values will reverse objects.
-
AffineParameters3D
public AffineParameters3D(double scale, double skewness) Constructor with scale and skewness.- Parameters:
scale- Scale to be set (in x, y and z axes). A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects size, and negative values will reverse objects.skewness- Skewness to be set for all axes.
-
AffineParameters3D
public AffineParameters3D(double scaleX, double scaleY, double scaleZ, double skewnessXY, double skewnessXZ, double skewnessYZ) Constructor with scale and skewness on each axis.- Parameters:
scaleX- Scale to be set on x-axis. A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects size, and negative values will reverse objects.scaleY- Scale to be set on y-axis. A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects.scaleZ- Scale to be set on z-axis. A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects.skewnessXY- Skewness to be set for axes x-y.skewnessXZ- Skewness to be set for axes x-z.skewnessYZ- Skewness to be set for axes y-z.
-
AffineParameters3D
public AffineParameters3D(com.irurueta.algebra.Matrix m, double threshold) Constructor with matrix and threshold.- Parameters:
m- Upper triangular matrix to extract affine parameters from.threshold- Threshold to determine whether provided matrix is a valid upper triangular one.- Throws:
IllegalArgumentException- Raised if provided matrix is not 3x3 or if it is not upper triangular, or if threshold is negative.
-
AffineParameters3D
public AffineParameters3D(com.irurueta.algebra.Matrix m) Constructor with matrix.- Parameters:
m- Upper triangular matrix to extract affine parameters from.- Throws:
IllegalArgumentException- Raised if provided matrix is not 3x3 or if it is not upper triangular, or if threshold is negative.
-
-
Method Details
-
getScaleX
public double getScaleX()Returns scale for x-axis. A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects size, and negative values will reverse objects.- Returns:
- Scale for x axis.
-
setScaleX
public void setScaleX(double scaleX) Sets scale for x-axis. A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects size, and negative values will reverse objects.- Parameters:
scaleX- scale to be set on x-axis.
-
getScaleY
public double getScaleY()Returns scale for y-axis. A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects size, and negative values will reverse objects.- Returns:
- Scale for y axis.
-
setScaleY
public void setScaleY(double scaleY) Sets scale for y-axis. A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects size, and negative values will reverse objects.- Parameters:
scaleY- scale to be set on y-axis.
-
getScaleZ
public double getScaleZ()Returns scale for z axis. A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects size, and negative values will reverse objects.- Returns:
- Scale for z axis.
-
setScaleZ
public void setScaleZ(double scaleZ) Sets scale for z axis. A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects size, and negative values will reverse objects.- Parameters:
scaleZ- scale to be set on z axis.
-
setScale
public void setScale(double scale) Sets overall scale (for x, y and z axes). A value between 0.0 and 1.0 will reduce objects size, a value larger than 1.0 will enlarge objects size, and negative values will reverse objects.- Parameters:
scale- Scale to be set for x, y and z axes.
-
getSkewnessXY
public double getSkewnessXY()Returns skewness value for x-y axes. A value of 0.0 indicates that horizontal and vertical axis are orthogonal, otherwise they are slanted to each other.- Returns:
- Skewness value for x-y axes.
-
setSkewnessXY
public void setSkewnessXY(double skewnessXY) Sets skewness value for x-y axes. A value of 0.0 indicates that horizontal and vertical axis are orthogonal, otherwise they are slanted to each other.- Parameters:
skewnessXY- Skewness to be set for x-y axes.
-
getSkewnessXZ
public double getSkewnessXZ()Returns skewness value for x-z axes. A value of 0.0 indicates that horizontal and vertical axis are orthogonal, otherwise they are slanted to each other.- Returns:
- Skewness value for x-z axes.
-
setSkewnessXZ
public void setSkewnessXZ(double skewnessXZ) Sets skewness value for x-z axes. A value of 0.0 indicates that horizontal and vertical axis are orthogonal, otherwise they are slanted to each other.- Parameters:
skewnessXZ- Skewness to be set for x-z axes.
-
getSkewnessYZ
public double getSkewnessYZ()Returns skewness value for y-z axes. A value of 0.0 indicates that horizontal and vertical axis are orthogonal, otherwise they are slanted to each other.- Returns:
- Skewness value for y-z axes.
-
setSkewnessYZ
public void setSkewnessYZ(double skewnessYZ) Sets skewness value for y-z axes. A value of 0.0 indicates that horizontal and vertical axis are orthogonal, otherwise they are slanted to each other.- Parameters:
skewnessYZ- Skewness to be set for y-z axes.
-
asMatrix
public com.irurueta.algebra.Matrix asMatrix()Converts this affine parameters instance into matrix representation- Returns:
- A matrix representation of this instance.
-
asMatrix
public void asMatrix(com.irurueta.algebra.Matrix m) Converts this affine parameters instance into matrix representation and stores the result into provided matrix.- Parameters:
m- Matrix where representation of this instance will be stored.- Throws:
IllegalArgumentException- Raised if provided matrix is not 3x3.
-
fromMatrix
public final void fromMatrix(com.irurueta.algebra.Matrix m) Sets parameters of this instance from provided matrix.- Parameters:
m- Matrix to set parameters from. Provided matrix must be 3x3 and upper triangular.- Throws:
IllegalArgumentException- Raised if provided matrix is not 3x3 or if it is not upper triangular.
-
fromMatrix
public final void fromMatrix(com.irurueta.algebra.Matrix m, double threshold) Sets parameters of this instance from provided matrix.- Parameters:
m- Matrix to set parameters from. Provided matrix must be 3x3 and upper triangular up to provided threshold.threshold- Threshold to determine whether provided matrix is upper triangular. Matrix will be considered upper triangular if its lower triangular elements are smaller or equal than provided threshold.- Throws:
IllegalArgumentException- Raised if provided matrix is not 3x3 or if it is not upper triangular or if threshold is negative.
-
isValidMatrix
public static boolean isValidMatrix(com.irurueta.algebra.Matrix m) Returns boolean indicating whether provided matrix is a valid matrix to set affine parameters from. Valid matrices need to be 3x3 and upper triangular.- Parameters:
m- A matrix to determine whether it is valid to set affine parameters from.- Returns:
- True if matrix is valid, false otherwise.
-
isValidMatrix
public static boolean isValidMatrix(com.irurueta.algebra.Matrix m, double threshold) Returns boolean indicating whether provided matrix is a valid matrix to set affine parameters form. Valid matrices need to be 3x3 and upper triangular up to provided threshold. In Layman terms, a valid matrix lower triangular elements need to be smaller or equal than provided threshold.- Parameters:
m- A matrix to determine whether it is valid to set affine parameters from.threshold- A threshold to determine whether provided matrix is upper triangular. Matrix will be considered upper triangular if its lower triangular elements are smaller or equal than provided threshold (without taking into account the sign of the elements).- Returns:
- True if matrix is valid, false otherwise.
- Throws:
IllegalArgumentException- Raised if provided threshold is negative.
-