Class AffineParameters3D

java.lang.Object
com.irurueta.geometry.AffineParameters3D
All Implemented Interfaces:
Serializable

public class AffineParameters3D extends Object implements Serializable
This class defines additional parameters that can be defined on affine 3D transformations.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    Default scale value having no effect on transformations.
    static final double
    Default skewness value having no effect on transformations.
    private static final double
    Default threshold to determine whether a matrix is a valid 3x3 upper triangular one.
    static final int
    Number of inhomogeneous coordinates in 3D space.
    private double
    Scale on x coordinates.
    private double
    Scale on y coordinates.
    private double
    Scale on z coordinates.
    private double
    Skewness factor between axes x-y.
    private double
    Skewness factor between axes x-z.
    private double
    Skewness factor between axes y-z.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
    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 Type
    Method
    Description
    com.irurueta.algebra.Matrix
    Converts this affine parameters instance into matrix representation
    void
    asMatrix(com.irurueta.algebra.Matrix m)
    Converts this affine parameters instance into matrix representation and stores the result into provided matrix.
    final void
    fromMatrix(com.irurueta.algebra.Matrix m)
    Sets parameters of this instance from provided matrix.
    final void
    fromMatrix(com.irurueta.algebra.Matrix m, double threshold)
    Sets parameters of this instance from provided matrix.
    double
    Returns scale for x-axis.
    double
    Returns scale for y-axis.
    double
    Returns scale for z axis.
    double
    Returns skewness value for x-y axes.
    double
    Returns skewness value for x-z axes.
    double
    Returns skewness value for y-z axes.
    static boolean
    isValidMatrix(com.irurueta.algebra.Matrix m)
    Returns boolean indicating whether provided matrix is a valid matrix to set affine parameters from.
    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.
    void
    setScale(double scale)
    Sets overall scale (for x, y and z axes).
    void
    setScaleX(double scaleX)
    Sets scale for x-axis.
    void
    setScaleY(double scaleY)
    Sets scale for y-axis.
    void
    setScaleZ(double scaleZ)
    Sets scale for z axis.
    void
    setSkewnessXY(double skewnessXY)
    Sets skewness value for x-y axes.
    void
    setSkewnessXZ(double skewnessXZ)
    Sets skewness value for x-z axes.
    void
    setSkewnessYZ(double skewnessYZ)
    Sets skewness value for y-z axes.

    Methods inherited from class java.lang.Object

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

    • DEFAULT_SCALE

      public static final double DEFAULT_SCALE
      Default scale value having no effect on transformations.
      See Also:
    • DEFAULT_SKEWNESS

      public static final double DEFAULT_SKEWNESS
      Default skewness value having no effect on transformations.
      See Also:
    • INHOM_COORDS

      public static final int INHOM_COORDS
      Number of inhomogeneous coordinates in 3D space.
      See Also:
    • DEFAULT_VALID_THRESHOLD

      private static final double DEFAULT_VALID_THRESHOLD
      Default threshold to determine whether a matrix is a valid 3x3 upper triangular one.
      See Also:
    • scaleX

      private double scaleX
      Scale on x coordinates.
    • scaleY

      private double scaleY
      Scale on y coordinates.
    • scaleZ

      private double scaleZ
      Scale on z coordinates.
    • skewnessXY

      private double skewnessXY
      Skewness factor between axes x-y. If 0.0, x and y axes remain orthogonal, otherwise they get slanted.
    • skewnessXZ

      private double skewnessXZ
      Skewness factor between axes x-z. If 0.0, x and z axes remain orthogonal, otherwise they get slanted.
    • skewnessYZ

      private double skewnessYZ
      Skewness 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.