RigidMatrix Type
An immutable 4x3 rigid matrix. For only rotation and translation in 3D space. This matrix guarantees to NOT scale, shear, flip, mirror, reflect or project. Angles are preserved. Lengths are preserved. Area is preserved. Volume is preserved. A rigid matrix is a matrix whose 3x3 columns and rows are orthogonal unit-vectors. The matrix is represented in the following column-vector syntax form: M11 M21 M31 X41 M12 M22 M32 Y42 M13 M23 M33 Z43 Where X41, Y42 and Z43 refer to the translation part of the RigidMatrix. The Determinant of this matrix is always 1.0. Note: Never use the struct default constructor RigidMatrix() as it will create an invalid zero RigidMatrix. Use RigidMatrix.create or RigidMatrix.createUnchecked instead.
Record fields
Record Field |
Description
|
Full Usage:
M11
Field type: float
|
|
Full Usage:
M12
Field type: float
|
|
Full Usage:
M13
Field type: float
|
|
Full Usage:
M21
Field type: float
|
|
Full Usage:
M22
Field type: float
|
|
Full Usage:
M23
Field type: float
|
|
Full Usage:
M31
Field type: float
|
|
Full Usage:
M32
Field type: float
|
|
Full Usage:
M33
Field type: float
|
|
Full Usage:
X41
Field type: float
|
|
Full Usage:
Y42
Field type: float
|
|
Full Usage:
Z43
Field type: float
|
|
Instance members
Instance member |
Description
|
Full Usage:
this.ByColumns
Returns: float[]
|
Returns the 12 elements column-major order: [| M11 M12 M13 M21 M22 M23 M31 M32 M33 X41 Y42 Z43 |] Where X41, Y42 and Z43 refer to the translation part of the RigidMatrix.
|
Full Usage:
this.ByRows
Returns: float[]
|
Returns the 12 elements in row-major order: [| M11 M21 M31 X41 M12 M22 M32 Y42 M13 M23 M33 Z43 |] Where X41, Y42 and Z43 refer to the translation part of the RigidMatrix.
|
|
Returns the first column vector. M11, M12 and M13
|
|
Returns the second column vector. M21, M22 and M23
|
|
Returns the third column vector. M31, M32 and M33
|
Full Usage:
this.Determinant
Returns: float
|
The Determinant of an Rigid Matrix is always 1.0 The Determinant describes the volume that a unit cube will have after the matrix was applied.
|
|
Inverts the RigidMatrix. Rigid matrices have always determinant 1.0 so the can always be inverted.
|
Full Usage:
this.IsIdentity
Returns: bool
|
Checks if the Matrix is an Identity Matrix in the form of: 1 0 0 0 0 1 0 0 0 0 1 0 Using an approximate tolerance of 1e-6.
|
|
Returns the translation or forth column vector. X41, Y42 and Z43
|
Static members
Static member |
Description
|
|
|
|
Multiplies (or applies) a RigidMatrix to a 3D vector . Since a 3D vector represents a direction or an offset in space, but not a location, all translations are ignored. (Homogeneous Vector)
|
|
Multiplies (or applies) a RigidMatrix to a 3D point. Since a 3D vector represents a direction or an offset in space, but not a location, all translations are ignored. (Homogeneous Vector)
|
Full Usage:
matrixA *** matrixB
Parameters:
RigidMatrix
matrixB : RigidMatrix
Returns: RigidMatrix
Modifiers: inline |
Multiplies matrixA with matrixB. The resulting transformation will first do matrixA and then matrixB.
|
|
|
Full Usage:
RigidMatrix.addTranslationXYZ x y z m
Parameters:
float
y : float
z : float
m : RigidMatrix
Returns: RigidMatrix
|
Add a X, Y and Z translation to an existing RigidMatrix.
|
|
Tries to create a 3x4 RigidMatrix from a general 4x4 matrix. Fails if the input matrix does scale, shear, flip, mirror, reflect or project. However, translation is allowed.
|
Full Usage:
RigidMatrix.createFromQuaternion quaternion
Parameters:
Quaternion
Returns: RigidMatrix
|
|
|
Creates a RigidMatrix to transform from one Plane or Coordinate System to another Plane.
|
Full Usage:
RigidMatrix.createRotationAxis (axis, angleDegrees)
Parameters:
Vec
angleDegrees : float
Returns: RigidMatrix
|
Creates a rotation around an Axis RigidMatrix. axis — Rotation axis, a vector of any length but 0.0 . angleDegrees — Rotation angle in Degrees. Returns a positive rotation, so clockwise looking in the direction of the axis vector.
|
Full Usage:
RigidMatrix.createRotationAxis (axis, angleDegrees)
Parameters:
UnitVec
angleDegrees : float
Returns: RigidMatrix
|
Creates a rotation around an Axis RigidMatrix. axis — Rotation axis, as unit-vector. angleDegrees — Rotation angle in Degrees. Returns a positive rotation, so clockwise looking in the direction of the axis vector.
|
Full Usage:
RigidMatrix.createRotationAxisCenter (axis, cen, angleDegrees)
Parameters: Returns: RigidMatrix
|
Creates a rotation matrix around an Axis at a given center point. axis — Rotation axis, a unit-vector. cen — The center point for the rotation. angleDegrees — Rotation angle in Degrees. Returns a positive rotation, so clockwise looking in the direction of the axis vector.
|
Full Usage:
RigidMatrix.createRotationAxisCenter (axis, cen, angleDegrees)
Parameters: Returns: RigidMatrix
|
Creates a rotation matrix around an Axis at a given center point. axis — Rotation axis, a vector of any length but 0.0 cen — The center point for the rotation. angleDegrees — Rotation angle in Degrees. Returns a positive rotation, so clockwise looking in the direction of the axis vector.
|
Full Usage:
RigidMatrix.createRotationX angleDegrees
Parameters:
float
Returns: RigidMatrix
|
Creates a rotation around the X-axis RigidMatrix by angle in Degrees (not Radians). angleDegrees — Rotation angle in Degrees. A positive rotation will be from Y towards Z-axis, so counter-clockwise looking onto Y-X Plane. The resulting RigidMatrix will be: 1 0 0 0 0 cos(θ) -sin(θ) 0 0 sin(θ) cos(θ) 0
|
Full Usage:
RigidMatrix.createRotationY angleDegrees
Parameters:
float
Returns: RigidMatrix
|
Creates a rotation around the Y-axis RigidMatrix by angle in Degrees (not Radians). angleDegrees — Rotation angle in Degrees. A positive rotation will be from Z towards X-axis, so counter-clockwise looking onto Z-X Plane. The resulting RigidMatrix will be: cos(θ) 0 sin(θ) 0 0 1 0 0 -sin(θ) 0 cos(θ) 0
|
Full Usage:
RigidMatrix.createRotationZ angleDegrees
Parameters:
float
Returns: RigidMatrix
|
Creates a rotation around the Z-axis RigidMatrix by angle in Degrees (not Radians). angleDegrees — Rotation angle in Degrees. Returns a positive rotation will be from X toward Y-axis, so counter-clockwise looking onto X-Y plane. The resulting RigidMatrix will be: cos(θ) -sin(θ) 0 0 sin(θ) cos(θ) 0 0 0 0 1 0
|
|
Creates a RigidMatrix to transform from World plane or Coordinate System to given Plane. Also called Change of Basis.
|
|
Creates a translation RigidMatrix: Vec - the vector by which to translate. The resulting RigidMatrix will be: 1 0 0 v.X 0 1 0 v.Y 0 0 1 v.Z
|
Full Usage:
RigidMatrix.createTranslation (x, y, z)
Parameters:
float
y : float
z : float
Returns: RigidMatrix
|
Creates a translation RigidMatrix: x - the amount to translate in the X-axis. y - the amount to translate in the Y-axis. z - the amount to translate in the Z-axis. The resulting matrix will be: 1 0 0 x 0 1 0 y 0 0 1 z
|
|
Creates a translation RigidMatrix: x - the amount by which to translate in X-axis. The resulting RigidMatrix will be: 1 0 0 x 0 1 0 0 0 0 1 0
|
|
Creates a translation RigidMatrix: y - the amount by which to translate in Y-axis. The resulting RigidMatrix will be: 1 0 0 0 0 1 0 y 0 0 1 0
|
|
Creates a translation RigidMatrix: z - the amount by which to translate in Z-axis. The resulting RigidMatrix will be: 1 0 0 0 0 1 0 0 0 0 1 z
|
|
Creates a rotation from one vectors direction to another vectors direction. If the tips of the two vectors unitized are closer than 1e-9 the identity matrix is returned. If the tips of the two vectors are almost exactly opposite, deviating less than 1e-6 from line (unitized), there is no valid unique 180 degree rotation that can be found, so an exception is raised.
|
|
Creates a rotation from one vectors direction to another vectors direction. If the tips of the two vectors are closer than 1e-9 the identity matrix is returned. If the tips of the two vectors are almost exactly opposite, deviating less than 1e-6 from line, there is no valid unique 180 degree rotation that can be found, so an exception is raised.
|
|
The Determinant of an Rigid Matrix is always 1.0 The Determinant describes the volume that a unit cube will have have the matrix was applied.
|
Full Usage:
RigidMatrix.equals tol a b
Parameters:
float
a : RigidMatrix
b : RigidMatrix
Returns: bool
|
Checks if two Matrices are equal within tolerance. By comparing the fields M11 to M44 each with the given tolerance. Use a tolerance of 0.0 to check for an exact match.
|
|
Returns the Identity RigidMatrix: 1 0 0 0 0 1 0 0 0 0 1 0
|
Full Usage:
RigidMatrix.inverse m
Parameters:
RigidMatrix
Returns: RigidMatrix
Modifiers: inline |
Inverses the RigidMatrix. An RigidMatrix can always be inverted. (as opposed to a general Matrix)
|
Full Usage:
RigidMatrix.multiply (matrixA, matrixB)
Parameters:
RigidMatrix
matrixB : RigidMatrix
Returns: RigidMatrix
|
Multiplies matrixA with matrixB. The resulting transformation will first do matrixA and then matrixB.
|
|
Removes the translation part by setting X41, Y42 and Z43 to 0.0.
|
|
Tries to create a 3x4 RigidMatrix from a general 4x4 matrix. Returns None if the input matrix does scale, shear, flip, mirror, reflect or project. However, translation is allowed.
|