public class Matrix3d extends Object implements Externalizable, Matrix3dc
m00 m10 m20
m01 m11 m21
m02 m12 m22
| Modifier and Type | Field and Description |
|---|---|
double |
m00 |
double |
m01 |
double |
m02 |
double |
m10 |
double |
m11 |
double |
m12 |
double |
m20 |
double |
m21 |
double |
m22 |
| Constructor and Description |
|---|
Matrix3d()
|
Matrix3d(DoubleBuffer buffer)
Create a new
Matrix3d by reading its 9 double components from the given DoubleBuffer
at the buffer's current position. |
Matrix3d(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22)
Create a new
Matrix3d and initialize its elements with the given values. |
Matrix3d(Matrix2dc mat)
|
Matrix3d(Matrix2fc mat)
|
Matrix3d(Matrix3dc mat)
Create a new
Matrix3d and initialize it with the values from the given matrix. |
Matrix3d(Matrix3fc mat)
Create a new
Matrix3d and initialize it with the values from the given matrix. |
Matrix3d(Matrix4dc mat)
|
Matrix3d(Matrix4fc mat)
|
Matrix3d(Vector3dc col0,
Vector3dc col1,
Vector3dc col2)
Create a new
Matrix3d and initialize its three columns using the supplied vectors. |
| Modifier and Type | Method and Description |
|---|---|
Matrix3d |
_m00(double m00)
Set the value of the matrix element at column 0 and row 0.
|
Matrix3d |
_m01(double m01)
Set the value of the matrix element at column 0 and row 1.
|
Matrix3d |
_m02(double m02)
Set the value of the matrix element at column 0 and row 2.
|
Matrix3d |
_m10(double m10)
Set the value of the matrix element at column 1 and row 0.
|
Matrix3d |
_m11(double m11)
Set the value of the matrix element at column 1 and row 1.
|
Matrix3d |
_m12(double m12)
Set the value of the matrix element at column 1 and row 2.
|
Matrix3d |
_m20(double m20)
Set the value of the matrix element at column 2 and row 0.
|
Matrix3d |
_m21(double m21)
Set the value of the matrix element at column 2 and row 1.
|
Matrix3d |
_m22(double m22)
Set the value of the matrix element at column 2 and row 2.
|
Matrix3d |
add(Matrix3dc other)
Component-wise add
this and other. |
Matrix3d |
add(Matrix3dc other,
Matrix3d dest)
Component-wise add
this and other and store the result in dest. |
double |
determinant()
Return the determinant of this matrix.
|
boolean |
equals(Matrix3dc m,
double delta)
Compare the matrix elements of
this matrix with the given matrix using the given delta
and return whether all of them are equal within a maximum difference of delta. |
boolean |
equals(Object obj) |
ByteBuffer |
get(ByteBuffer buffer)
Store this matrix in column-major order into the supplied
ByteBuffer at the current
buffer position. |
double[] |
get(double[] arr)
Store this matrix into the supplied double array in column-major order.
|
double[] |
get(double[] arr,
int offset)
Store this matrix into the supplied double array in column-major order at the given offset.
|
DoubleBuffer |
get(DoubleBuffer buffer)
Store this matrix into the supplied
DoubleBuffer at the current
buffer position using column-major order. |
float[] |
get(float[] arr)
Store the elements of this matrix as float values in column-major order into the supplied float array.
|
float[] |
get(float[] arr,
int offset)
Store the elements of this matrix as float values in column-major order into the supplied float array at the given offset.
|
FloatBuffer |
get(FloatBuffer buffer)
Store this matrix in column-major order into the supplied
FloatBuffer at the current
buffer position. |
ByteBuffer |
get(int index,
ByteBuffer buffer)
Store this matrix in column-major order into the supplied
ByteBuffer starting at the specified
absolute buffer position/index. |
DoubleBuffer |
get(int index,
DoubleBuffer buffer)
Store this matrix into the supplied
DoubleBuffer starting at the specified
absolute buffer position/index using column-major order. |
FloatBuffer |
get(int index,
FloatBuffer buffer)
Store this matrix in column-major order into the supplied
FloatBuffer starting at the specified
absolute buffer position/index. |
double |
get(int column,
int row)
Get the matrix element value at the given column and row.
|
Matrix3d |
get(Matrix3d dest)
Get the current values of
this matrix and store them into
dest. |
Vector3d |
getColumn(int column,
Vector3d dest)
Get the column at the given
column index, starting with 0. |
Vector3d |
getEulerAnglesZYX(Vector3d dest)
Extract the Euler angles from the rotation represented by
this matrix and store the extracted Euler angles in dest. |
ByteBuffer |
getFloats(ByteBuffer buffer)
Store the elements of this matrix as float values in column-major order into the supplied
ByteBuffer at the current
buffer position. |
ByteBuffer |
getFloats(int index,
ByteBuffer buffer)
Store the elements of this matrix as float values in column-major order into the supplied
ByteBuffer
starting at the specified absolute buffer position/index. |
Quaterniond |
getNormalizedRotation(Quaterniond dest)
Get the current values of
this matrix and store the represented rotation
into the given Quaterniond. |
Quaternionf |
getNormalizedRotation(Quaternionf dest)
Get the current values of
this matrix and store the represented rotation
into the given Quaternionf. |
AxisAngle4f |
getRotation(AxisAngle4f dest)
Get the current values of
this matrix and store the represented rotation
into the given AxisAngle4f. |
Vector3d |
getRow(int row,
Vector3d dest)
Get the row at the given
row index, starting with 0. |
Vector3d |
getScale(Vector3d dest)
Get the scaling factors of
this matrix for the three base axes. |
Quaterniond |
getUnnormalizedRotation(Quaterniond dest)
Get the current values of
this matrix and store the represented rotation
into the given Quaterniond. |
Quaternionf |
getUnnormalizedRotation(Quaternionf dest)
Get the current values of
this matrix and store the represented rotation
into the given Quaternionf. |
int |
hashCode() |
Matrix3d |
identity()
Set this matrix to the identity.
|
Matrix3d |
invert()
Invert this matrix.
|
Matrix3d |
invert(Matrix3d dest)
Invert
this matrix and store the result in dest. |
Matrix3d |
lerp(Matrix3dc other,
double t)
Linearly interpolate
this and other using the given interpolation factor t
and store the result in this. |
Matrix3d |
lerp(Matrix3dc other,
double t,
Matrix3d dest)
Linearly interpolate
this and other using the given interpolation factor t
and store the result in dest. |
Matrix3d |
lookAlong(double dirX,
double dirY,
double dirZ,
double upX,
double upY,
double upZ)
Apply a rotation transformation to this matrix to make
-z point along dir. |
Matrix3d |
lookAlong(double dirX,
double dirY,
double dirZ,
double upX,
double upY,
double upZ,
Matrix3d dest)
Apply a rotation transformation to this matrix to make
-z point along dir
and store the result in dest. |
Matrix3d |
lookAlong(Vector3dc dir,
Vector3dc up)
Apply a rotation transformation to this matrix to make
-z point along dir. |
Matrix3d |
lookAlong(Vector3dc dir,
Vector3dc up,
Matrix3d dest)
Apply a rotation transformation to this matrix to make
-z point along dir
and store the result in dest. |
double |
m00()
Return the value of the matrix element at column 0 and row 0.
|
Matrix3d |
m00(double m00)
Set the value of the matrix element at column 0 and row 0.
|
double |
m01()
Return the value of the matrix element at column 0 and row 1.
|
Matrix3d |
m01(double m01)
Set the value of the matrix element at column 0 and row 1.
|
double |
m02()
Return the value of the matrix element at column 0 and row 2.
|
Matrix3d |
m02(double m02)
Set the value of the matrix element at column 0 and row 2.
|
double |
m10()
Return the value of the matrix element at column 1 and row 0.
|
Matrix3d |
m10(double m10)
Set the value of the matrix element at column 1 and row 0.
|
double |
m11()
Return the value of the matrix element at column 1 and row 1.
|
Matrix3d |
m11(double m11)
Set the value of the matrix element at column 1 and row 1.
|
double |
m12()
Return the value of the matrix element at column 1 and row 2.
|
Matrix3d |
m12(double m12)
Set the value of the matrix element at column 1 and row 2.
|
double |
m20()
Return the value of the matrix element at column 2 and row 0.
|
Matrix3d |
m20(double m20)
Set the value of the matrix element at column 2 and row 0.
|
double |
m21()
Return the value of the matrix element at column 2 and row 1.
|
Matrix3d |
m21(double m21)
Set the value of the matrix element at column 2 and row 1.
|
double |
m22()
Return the value of the matrix element at column 2 and row 2.
|
Matrix3d |
m22(double m22)
Set the value of the matrix element at column 2 and row 2.
|
Matrix3d |
mul(Matrix3dc right)
Multiply this matrix by the supplied matrix.
|
Matrix3d |
mul(Matrix3dc right,
Matrix3d dest)
Multiply this matrix by the supplied matrix and store the result in
dest. |
Matrix3d |
mul(Matrix3fc right)
Multiply this matrix by the supplied matrix.
|
Matrix3d |
mul(Matrix3fc right,
Matrix3d dest)
Multiply this matrix by the supplied matrix and store the result in
dest. |
Matrix3d |
mulComponentWise(Matrix3dc other)
Component-wise multiply
this by other. |
Matrix3d |
mulComponentWise(Matrix3dc other,
Matrix3d dest)
Component-wise multiply
this by other and store the result in dest. |
Matrix3d |
mulLocal(Matrix3dc left)
Pre-multiply this matrix by the supplied
left matrix and store the result in this. |
Matrix3d |
mulLocal(Matrix3dc left,
Matrix3d dest)
Pre-multiply this matrix by the supplied
left matrix and store the result in dest. |
Matrix3d |
normal()
Set
this matrix to its own normal matrix. |
Matrix3d |
normal(Matrix3d dest)
Compute a normal matrix from
this matrix and store it into dest. |
Vector3d |
normalizedPositiveX(Vector3d dir)
Obtain the direction of
+X before the transformation represented by this orthogonal matrix is applied. |
Vector3d |
normalizedPositiveY(Vector3d dir)
Obtain the direction of
+Y before the transformation represented by this orthogonal matrix is applied. |
Vector3d |
normalizedPositiveZ(Vector3d dir)
Obtain the direction of
+Z before the transformation represented by this orthogonal matrix is applied. |
Matrix3d |
obliqueZ(double a,
double b)
Apply an oblique projection transformation to this matrix with the given values for
a and
b. |
Matrix3d |
obliqueZ(double a,
double b,
Matrix3d dest)
Apply an oblique projection transformation to this matrix with the given values for
a and
b and store the result in dest. |
Vector3d |
positiveX(Vector3d dir)
Obtain the direction of
+X before the transformation represented by this matrix is applied. |
Vector3d |
positiveY(Vector3d dir)
Obtain the direction of
+Y before the transformation represented by this matrix is applied. |
Vector3d |
positiveZ(Vector3d dir)
Obtain the direction of
+Z before the transformation represented by this matrix is applied. |
void |
readExternal(ObjectInput in) |
Matrix3d |
rotate(AxisAngle4d axisAngle)
Apply a rotation transformation, rotating about the given
AxisAngle4d, to this matrix. |
Matrix3d |
rotate(AxisAngle4d axisAngle,
Matrix3d dest)
Apply a rotation transformation, rotating about the given
AxisAngle4d and store the result in dest. |
Matrix3d |
rotate(AxisAngle4f axisAngle)
Apply a rotation transformation, rotating about the given
AxisAngle4f, to this matrix. |
Matrix3d |
rotate(AxisAngle4f axisAngle,
Matrix3d dest)
Apply a rotation transformation, rotating about the given
AxisAngle4f and store the result in dest. |
Matrix3d |
rotate(double ang,
double x,
double y,
double z)
Apply rotation to this matrix by rotating the given amount of radians
about the given axis specified as x, y and z components.
|
Matrix3d |
rotate(double ang,
double x,
double y,
double z,
Matrix3d dest)
Apply rotation to this matrix by rotating the given amount of radians
about the given axis specified as x, y and z components, and store the result in
dest. |
Matrix3d |
rotate(double angle,
Vector3dc axis)
Apply a rotation transformation, rotating the given radians about the specified axis, to this matrix.
|
Matrix3d |
rotate(double angle,
Vector3dc axis,
Matrix3d dest)
Apply a rotation transformation, rotating the given radians about the specified axis and store the result in
dest. |
Matrix3d |
rotate(double angle,
Vector3fc axis)
Apply a rotation transformation, rotating the given radians about the specified axis, to this matrix.
|
Matrix3d |
rotate(double angle,
Vector3fc axis,
Matrix3d dest)
Apply a rotation transformation, rotating the given radians about the specified axis and store the result in
dest. |
Matrix3d |
rotate(Quaterniondc quat)
Apply the rotation - and possibly scaling - transformation of the given
Quaterniondc to this matrix. |
Matrix3d |
rotate(Quaterniondc quat,
Matrix3d dest)
Apply the rotation - and possibly scaling - transformation of the given
Quaterniondc to this matrix and store
the result in dest. |
Matrix3d |
rotate(Quaternionfc quat)
Apply the rotation - and possibly scaling - transformation of the given
Quaternionfc to this matrix. |
Matrix3d |
rotate(Quaternionfc quat,
Matrix3d dest)
Apply the rotation - and possibly scaling - transformation of the given
Quaternionfc to this matrix and store
the result in dest. |
Matrix3d |
rotateLocal(double ang,
double x,
double y,
double z)
Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified
(x, y, z) axis. |
Matrix3d |
rotateLocal(double ang,
double x,
double y,
double z,
Matrix3d dest)
Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified
(x, y, z) axis and store the result in dest. |
Matrix3d |
rotateLocal(Quaterniondc quat)
Pre-multiply the rotation - and possibly scaling - transformation of the given
Quaterniondc to this matrix. |
Matrix3d |
rotateLocal(Quaterniondc quat,
Matrix3d dest)
Pre-multiply the rotation - and possibly scaling - transformation of the given
Quaterniondc to this matrix and store
the result in dest. |
Matrix3d |
rotateLocal(Quaternionfc quat)
Pre-multiply the rotation - and possibly scaling - transformation of the given
Quaternionfc to this matrix. |
Matrix3d |
rotateLocal(Quaternionfc quat,
Matrix3d dest)
Pre-multiply the rotation - and possibly scaling - transformation of the given
Quaternionfc to this matrix and store
the result in dest. |
Matrix3d |
rotateLocalX(double ang)
Pre-multiply a rotation to this matrix by rotating the given amount of radians about the X axis.
|
Matrix3d |
rotateLocalX(double ang,
Matrix3d dest)
Pre-multiply a rotation around the X axis to this matrix by rotating the given amount of radians
about the X axis and store the result in
dest. |
Matrix3d |
rotateLocalY(double ang)
Pre-multiply a rotation to this matrix by rotating the given amount of radians about the Y axis.
|
Matrix3d |
rotateLocalY(double ang,
Matrix3d dest)
Pre-multiply a rotation around the Y axis to this matrix by rotating the given amount of radians
about the Y axis and store the result in
dest. |
Matrix3d |
rotateLocalZ(double ang)
Pre-multiply a rotation to this matrix by rotating the given amount of radians about the Z axis.
|
Matrix3d |
rotateLocalZ(double ang,
Matrix3d dest)
Pre-multiply a rotation around the Z axis to this matrix by rotating the given amount of radians
about the Z axis and store the result in
dest. |
Matrix3d |
rotateTowards(double dirX,
double dirY,
double dirZ,
double upX,
double upY,
double upZ)
Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local
+Z axis with direction. |
Matrix3d |
rotateTowards(double dirX,
double dirY,
double dirZ,
double upX,
double upY,
double upZ,
Matrix3d dest)
Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local
+Z axis with dir
and store the result in dest. |
Matrix3d |
rotateTowards(Vector3dc direction,
Vector3dc up)
Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local
+Z axis with direction. |
Matrix3d |
rotateTowards(Vector3dc direction,
Vector3dc up,
Matrix3d dest)
Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local
+Z axis with direction
and store the result in dest. |
Matrix3d |
rotateX(double ang)
Apply rotation about the X axis to this matrix by rotating the given amount of radians.
|
Matrix3d |
rotateX(double ang,
Matrix3d dest)
Apply rotation about the X axis to this matrix by rotating the given amount of radians
and store the result in
dest. |
Matrix3d |
rotateXYZ(double angleX,
double angleY,
double angleZ)
Apply rotation of
angleX radians about the X axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleZ radians about the Z axis. |
Matrix3d |
rotateXYZ(double angleX,
double angleY,
double angleZ,
Matrix3d dest)
Apply rotation of
angleX radians about the X axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleZ radians about the Z axis and store the result in dest. |
Matrix3d |
rotateY(double ang)
Apply rotation about the Y axis to this matrix by rotating the given amount of radians.
|
Matrix3d |
rotateY(double ang,
Matrix3d dest)
Apply rotation about the Y axis to this matrix by rotating the given amount of radians
and store the result in
dest. |
Matrix3d |
rotateYXZ(double angleY,
double angleX,
double angleZ)
Apply rotation of
angleY radians about the Y axis, followed by a rotation of angleX radians about the X axis and
followed by a rotation of angleZ radians about the Z axis. |
Matrix3d |
rotateYXZ(double angleY,
double angleX,
double angleZ,
Matrix3d dest)
Apply rotation of
angleY radians about the Y axis, followed by a rotation of angleX radians about the X axis and
followed by a rotation of angleZ radians about the Z axis and store the result in dest. |
Matrix3d |
rotateYXZ(Vector3d angles)
Apply rotation of
angles.y radians about the Y axis, followed by a rotation of angles.x radians about the X axis and
followed by a rotation of angles.z radians about the Z axis. |
Matrix3d |
rotateZ(double ang)
Apply rotation about the Z axis to this matrix by rotating the given amount of radians.
|
Matrix3d |
rotateZ(double ang,
Matrix3d dest)
Apply rotation about the Z axis to this matrix by rotating the given amount of radians
and store the result in
dest. |
Matrix3d |
rotateZYX(double angleZ,
double angleY,
double angleX)
Apply rotation of
angleZ radians about the Z axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleX radians about the X axis. |
Matrix3d |
rotateZYX(double angleZ,
double angleY,
double angleX,
Matrix3d dest)
Apply rotation of
angleZ radians about the Z axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleX radians about the X axis and store the result in dest. |
Matrix3d |
rotation(AxisAngle4d axisAngle)
Set this matrix to a rotation transformation using the given
AxisAngle4d. |
Matrix3d |
rotation(AxisAngle4f axisAngle)
Set this matrix to a rotation transformation using the given
AxisAngle4f. |
Matrix3d |
rotation(double angle,
double x,
double y,
double z)
Set this matrix to a rotation matrix which rotates the given radians about a given axis.
|
Matrix3d |
rotation(double angle,
Vector3dc axis)
Set this matrix to a rotation matrix which rotates the given radians about a given axis.
|
Matrix3d |
rotation(double angle,
Vector3fc axis)
Set this matrix to a rotation matrix which rotates the given radians about a given axis.
|
Matrix3d |
rotation(Quaterniondc quat)
Set this matrix to the rotation - and possibly scaling - transformation of the given
Quaterniondc. |
Matrix3d |
rotation(Quaternionfc quat)
Set this matrix to the rotation - and possibly scaling - transformation of the given
Quaternionfc. |
Matrix3d |
rotationTowards(double dirX,
double dirY,
double dirZ,
double upX,
double upY,
double upZ)
Set this matrix to a model transformation for a right-handed coordinate system,
that aligns the local
-z axis with center - eye. |
Matrix3d |
rotationTowards(Vector3dc dir,
Vector3dc up)
Set this matrix to a model transformation for a right-handed coordinate system,
that aligns the local
-z axis with center - eye. |
Matrix3d |
rotationX(double ang)
Set this matrix to a rotation transformation about the X axis.
|
Matrix3d |
rotationXYZ(double angleX,
double angleY,
double angleZ)
Set this matrix to a rotation of
angleX radians about the X axis, followed by a rotation
of angleY radians about the Y axis and followed by a rotation of angleZ radians about the Z axis. |
Matrix3d |
rotationY(double ang)
Set this matrix to a rotation transformation about the Y axis.
|
Matrix3d |
rotationYXZ(double angleY,
double angleX,
double angleZ)
Set this matrix to a rotation of
angleY radians about the Y axis, followed by a rotation
of angleX radians about the X axis and followed by a rotation of angleZ radians about the Z axis. |
Matrix3d |
rotationZ(double ang)
Set this matrix to a rotation transformation about the Z axis.
|
Matrix3d |
rotationZYX(double angleZ,
double angleY,
double angleX)
Set this matrix to a rotation of
angleZ radians about the Z axis, followed by a rotation
of angleY radians about the Y axis and followed by a rotation of angleX radians about the X axis. |
Matrix3d |
scale(double xyz)
Apply scaling to this matrix by uniformly scaling all base axes by the given
xyz factor. |
Matrix3d |
scale(double x,
double y,
double z)
Apply scaling to this matrix by scaling the base axes by the given x,
y and z factors.
|
Matrix3d |
scale(double x,
double y,
double z,
Matrix3d dest)
Apply scaling to this matrix by scaling the base axes by the given x,
y and z factors and store the result in
dest. |
Matrix3d |
scale(double xyz,
Matrix3d dest)
Apply scaling to this matrix by uniformly scaling all base axes by the given
xyz factor
and store the result in dest. |
Matrix3d |
scale(Vector3dc xyz)
Apply scaling to this matrix by scaling the base axes by the given
xyz.x,
xyz.y and xyz.z factors, respectively. |
Matrix3d |
scale(Vector3dc xyz,
Matrix3d dest)
Apply scaling to
this matrix by scaling the base axes by the given xyz.x,
xyz.y and xyz.z factors, respectively and store the result in dest. |
Matrix3d |
scaleLocal(double x,
double y,
double z)
Pre-multiply scaling to this matrix by scaling the base axes by the given x,
y and z factors.
|
Matrix3d |
scaleLocal(double x,
double y,
double z,
Matrix3d dest)
Pre-multiply scaling to
this matrix by scaling the base axes by the given x,
y and z factors and store the result in dest. |
Matrix3d |
scaling(double factor)
Set this matrix to be a simple scale matrix, which scales all axes uniformly by the given factor.
|
Matrix3d |
scaling(double x,
double y,
double z)
Set this matrix to be a simple scale matrix.
|
Matrix3d |
scaling(Vector3dc xyz)
Set this matrix to be a simple scale matrix which scales the base axes by
xyz.x, xyz.y and xyz.z respectively. |
Matrix3d |
set(AxisAngle4d axisAngle)
Set this matrix to be equivalent to the rotation specified by the given
AxisAngle4d. |
Matrix3d |
set(AxisAngle4f axisAngle)
Set this matrix to be equivalent to the rotation specified by the given
AxisAngle4f. |
Matrix3d |
set(ByteBuffer buffer)
Set the values of this matrix by reading 9 double values from the given
ByteBuffer in column-major order,
starting at its current position. |
Matrix3d |
set(double[] m)
Set the values in this matrix based on the supplied double array.
|
Matrix3d |
set(DoubleBuffer buffer)
Set the values of this matrix by reading 9 double values from the given
DoubleBuffer in column-major order,
starting at its current position. |
Matrix3d |
set(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22)
Set the values within this matrix to the supplied double values.
|
Matrix3d |
set(float[] m)
Set the values in this matrix based on the supplied double array.
|
Matrix3d |
set(FloatBuffer buffer)
Set the values of this matrix by reading 9 float values from the given
FloatBuffer in column-major order,
starting at its current position. |
Matrix3d |
set(int column,
int row,
double value)
Set the matrix element at the given column and row to the specified value.
|
Matrix3d |
set(Matrix2dc mat)
|
Matrix3d |
set(Matrix2fc mat)
|
Matrix3d |
set(Matrix3dc m)
Set the values in this matrix to the ones in m.
|
Matrix3d |
set(Matrix3fc m)
Set the values in this matrix to the ones in m.
|
Matrix3d |
set(Matrix4dc mat)
Set the elements of this matrix to the upper left 3x3 of the given
Matrix4dc. |
Matrix3d |
set(Matrix4fc mat)
Set the elements of this matrix to the upper left 3x3 of the given
Matrix4fc. |
Matrix3d |
set(Matrix4x3dc m)
Set the elements of this matrix to the left 3x3 submatrix of
m. |
Matrix3d |
set(Quaterniondc q)
Set this matrix to a rotation - and possibly scaling - equivalent to the given quaternion.
|
Matrix3d |
set(Quaternionfc q)
Set this matrix to a rotation - and possibly scaling - equivalent to the given quaternion.
|
Matrix3d |
set(Vector3dc col0,
Vector3dc col1,
Vector3dc col2)
Set the three columns of this matrix to the supplied vectors, respectively.
|
Matrix3d |
setColumn(int column,
double x,
double y,
double z)
Set the column at the given
column index, starting with 0. |
Matrix3d |
setColumn(int column,
Vector3dc src)
Set the column at the given
column index, starting with 0. |
Matrix3d |
setFloats(ByteBuffer buffer)
Set the values of this matrix by reading 9 float values from the given
ByteBuffer in column-major order,
starting at its current position. |
Matrix3d |
setLookAlong(double dirX,
double dirY,
double dirZ,
double upX,
double upY,
double upZ)
Set this matrix to a rotation transformation to make
-z
point along dir. |
Matrix3d |
setLookAlong(Vector3dc dir,
Vector3dc up)
Set this matrix to a rotation transformation to make
-z
point along dir. |
Matrix3d |
setRow(int row,
double x,
double y,
double z)
Set the row at the given
row index, starting with 0. |
Matrix3d |
setRow(int row,
Vector3dc src)
Set the row at the given
row index, starting with 0. |
Matrix3d |
setSkewSymmetric(double a,
double b,
double c)
Set this matrix to a skew-symmetric matrix using the following layout:
|
Matrix3d |
sub(Matrix3dc subtrahend)
Component-wise subtract
subtrahend from this. |
Matrix3d |
sub(Matrix3dc subtrahend,
Matrix3d dest)
Component-wise subtract
subtrahend from this and store the result in dest. |
Matrix3d |
swap(Matrix3d other)
Exchange the values of
this matrix with the given other matrix. |
String |
toString()
Return a string representation of this matrix.
|
String |
toString(NumberFormat formatter)
Return a string representation of this matrix by formatting the matrix elements with the given
NumberFormat. |
Vector3d |
transform(double x,
double y,
double z,
Vector3d dest)
Transform the vector
(x, y, z) by this matrix and store the result in dest. |
Vector3d |
transform(Vector3d v)
Transform the given vector by this matrix.
|
Vector3d |
transform(Vector3dc v,
Vector3d dest)
Transform the given vector by this matrix and store the result in
dest. |
Vector3f |
transform(Vector3f v)
Transform the given vector by this matrix.
|
Vector3f |
transform(Vector3fc v,
Vector3f dest)
Transform the given vector by this matrix and store the result in
dest. |
Vector3d |
transformTranspose(double x,
double y,
double z,
Vector3d dest)
Transform the vector
(x, y, z) by the transpose of this matrix and store the result in dest. |
Vector3d |
transformTranspose(Vector3d v)
Transform the given vector by the transpose of this matrix.
|
Vector3d |
transformTranspose(Vector3dc v,
Vector3d dest)
Transform the given vector by the transpose of this matrix and store the result in
dest. |
Matrix3d |
transpose()
Transpose this matrix.
|
Matrix3d |
transpose(Matrix3d dest)
Transpose
this matrix and store the result in dest. |
void |
writeExternal(ObjectOutput out) |
Matrix3d |
zero()
Set all the values within this matrix to 0.
|
public double m00
public double m01
public double m02
public double m10
public double m11
public double m12
public double m20
public double m21
public double m22
public Matrix3d()
public Matrix3d(Matrix2dc mat)
Matrix3d by setting its uppper left 2x2 submatrix to the values of the given Matrix2dc
and the rest to identity.mat - the Matrix2dcpublic Matrix3d(Matrix2fc mat)
Matrix3d by setting its uppper left 2x2 submatrix to the values of the given Matrix2fc
and the rest to identity.mat - the Matrix2fcpublic Matrix3d(Matrix3dc mat)
Matrix3d and initialize it with the values from the given matrix.mat - the matrix to initialize this matrix withpublic Matrix3d(Matrix3fc mat)
Matrix3d and initialize it with the values from the given matrix.mat - the matrix to initialize this matrix withpublic Matrix3d(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22)
Matrix3d and initialize its elements with the given values.m00 - the value of m00m01 - the value of m01m02 - the value of m02m10 - the value of m10m11 - the value of m11m12 - the value of m12m20 - the value of m20m21 - the value of m21m22 - the value of m22public Matrix3d(DoubleBuffer buffer)
Matrix3d by reading its 9 double components from the given DoubleBuffer
at the buffer's current position.
That DoubleBuffer is expected to hold the values in column-major order.
The buffer's position will not be changed by this method.
buffer - the DoubleBuffer to read the matrix values frompublic double m00()
Matrix3dcpublic double m01()
Matrix3dcpublic double m02()
Matrix3dcpublic double m10()
Matrix3dcpublic double m11()
Matrix3dcpublic double m12()
Matrix3dcpublic double m20()
Matrix3dcpublic double m21()
Matrix3dcpublic double m22()
Matrix3dcpublic Matrix3d m00(double m00)
m00 - the new valuepublic Matrix3d m01(double m01)
m01 - the new valuepublic Matrix3d m02(double m02)
m02 - the new valuepublic Matrix3d m10(double m10)
m10 - the new valuepublic Matrix3d m11(double m11)
m11 - the new valuepublic Matrix3d m12(double m12)
m12 - the new valuepublic Matrix3d m20(double m20)
m20 - the new valuepublic Matrix3d m21(double m21)
m21 - the new valuepublic Matrix3d m22(double m22)
m22 - the new valuepublic Matrix3d _m00(double m00)
m00 - the new valuepublic Matrix3d _m01(double m01)
m01 - the new valuepublic Matrix3d _m02(double m02)
m02 - the new valuepublic Matrix3d _m10(double m10)
m10 - the new valuepublic Matrix3d _m11(double m11)
m11 - the new valuepublic Matrix3d _m12(double m12)
m12 - the new valuepublic Matrix3d _m20(double m20)
m20 - the new valuepublic Matrix3d _m21(double m21)
m21 - the new valuepublic Matrix3d _m22(double m22)
m22 - the new valuepublic Matrix3d set(Matrix3dc m)
m - the matrix whose values will be copiedpublic Matrix3d set(Matrix3fc m)
m - the matrix whose values will be copiedpublic Matrix3d set(Matrix4x3dc m)
m.m - the matrix to copy the elements frompublic Matrix3d set(Matrix4fc mat)
Matrix4fc.mat - the Matrix4fc to copy the values frompublic Matrix3d set(Matrix4dc mat)
Matrix4dc.mat - the Matrix4dc to copy the values frompublic Matrix3d set(Matrix2fc mat)
mat - the Matrix2fcMatrix3d(Matrix2fc)public Matrix3d set(Matrix2dc mat)
mat - the Matrix2dcMatrix3d(Matrix2dc)public Matrix3d set(AxisAngle4f axisAngle)
AxisAngle4f.axisAngle - the AxisAngle4fpublic Matrix3d set(AxisAngle4d axisAngle)
AxisAngle4d.axisAngle - the AxisAngle4dpublic Matrix3d set(Quaternionfc q)
This method is equivalent to calling: rotation(q)
Reference: http://www.euclideanspace.com/
q - the quaternionrotation(Quaternionfc)public Matrix3d set(Quaterniondc q)
This method is equivalent to calling: rotation(q)
Reference: http://www.euclideanspace.com/
q - the quaternionrotation(Quaterniondc)public Matrix3d mul(Matrix3dc right)
If M is this matrix and R the right matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
transformation of the right matrix will be applied first!
right - the right operandpublic Matrix3d mul(Matrix3dc right, Matrix3d dest)
Matrix3dcdest.
This matrix will be the left one.
If M is this matrix and R the right matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
transformation of the right matrix will be applied first!
public Matrix3d mulLocal(Matrix3dc left)
left matrix and store the result in this.
If M is this matrix and L the left matrix,
then the new matrix will be L * M. So when transforming a
vector v with the new matrix by using L * M * v, the
transformation of this matrix will be applied first!
left - the left operand of the matrix multiplicationpublic Matrix3d mulLocal(Matrix3dc left, Matrix3d dest)
Matrix3dcleft matrix and store the result in dest.
If M is this matrix and L the left matrix,
then the new matrix will be L * M. So when transforming a
vector v with the new matrix by using L * M * v, the
transformation of this matrix will be applied first!
public Matrix3d mul(Matrix3fc right)
If M is this matrix and R the right matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
transformation of the right matrix will be applied first!
right - the right operandpublic Matrix3d mul(Matrix3fc right, Matrix3d dest)
Matrix3dcdest.
This matrix will be the left one.
If M is this matrix and R the right matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
transformation of the right matrix will be applied first!
public Matrix3d set(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
m00, m10, m20
m01, m11, m21
m02, m12, m22
m00 - the new value of m00m01 - the new value of m01m02 - the new value of m02m10 - the new value of m10m11 - the new value of m11m12 - the new value of m12m20 - the new value of m20m21 - the new value of m21m22 - the new value of m22public Matrix3d set(double[] m)
0, 3, 6
1, 4, 7
2, 5, 8
Only uses the first 9 values, all others are ignored.
m - the array to read the matrix values frompublic Matrix3d set(float[] m)
0, 3, 6
1, 4, 7
2, 5, 8
Only uses the first 9 values, all others are ignored
m - the array to read the matrix values frompublic double determinant()
Matrix3dcdeterminant in interface Matrix3dcpublic Matrix3d invert()
public Matrix3d invert(Matrix3d dest)
Matrix3dcthis matrix and store the result in dest.public Matrix3d transpose()
public Matrix3d transpose(Matrix3d dest)
Matrix3dcthis matrix and store the result in dest.public String toString()
This method creates a new DecimalFormat on every invocation with the format string "0.000E0;-".
public String toString(NumberFormat formatter)
NumberFormat.formatter - the NumberFormat used to format the matrix values withpublic Matrix3d get(Matrix3d dest)
this matrix and store them into
dest.
This is the reverse method of set(Matrix3dc) and allows to obtain
intermediate calculation results when chaining multiple transformations.
get in interface Matrix3dcdest - the destination matrixset(Matrix3dc)public AxisAngle4f getRotation(AxisAngle4f dest)
Matrix3dcthis matrix and store the represented rotation
into the given AxisAngle4f.getRotation in interface Matrix3dcdest - the destination AxisAngle4fAxisAngle4f.set(Matrix3dc)public Quaternionf getUnnormalizedRotation(Quaternionf dest)
Matrix3dcthis matrix and store the represented rotation
into the given Quaternionf.
This method assumes that the three column vectors of this matrix are not normalized and thus allows to ignore any additional scaling factor that is applied to the matrix.
getUnnormalizedRotation in interface Matrix3dcdest - the destination QuaternionfQuaternionf.setFromUnnormalized(Matrix3dc)public Quaternionf getNormalizedRotation(Quaternionf dest)
Matrix3dcthis matrix and store the represented rotation
into the given Quaternionf.
This method assumes that the three column vectors of this matrix are normalized.
getNormalizedRotation in interface Matrix3dcdest - the destination QuaternionfQuaternionf.setFromNormalized(Matrix3dc)public Quaterniond getUnnormalizedRotation(Quaterniond dest)
Matrix3dcthis matrix and store the represented rotation
into the given Quaterniond.
This method assumes that the three column vectors of this matrix are not normalized and thus allows to ignore any additional scaling factor that is applied to the matrix.
getUnnormalizedRotation in interface Matrix3dcdest - the destination QuaterniondQuaterniond.setFromUnnormalized(Matrix3dc)public Quaterniond getNormalizedRotation(Quaterniond dest)
Matrix3dcthis matrix and store the represented rotation
into the given Quaterniond.
This method assumes that the three column vectors of this matrix are normalized.
getNormalizedRotation in interface Matrix3dcdest - the destination QuaterniondQuaterniond.setFromNormalized(Matrix3dc)public DoubleBuffer get(DoubleBuffer buffer)
Matrix3dcDoubleBuffer at the current
buffer position using column-major order.
This method will not increment the position of the given DoubleBuffer.
In order to specify the offset into the DoubleBuffer} at which
the matrix is stored, use Matrix3dc.get(int, DoubleBuffer), taking
the absolute position as parameter.
get in interface Matrix3dcbuffer - will receive the values of this matrix in column-major order at its current positionMatrix3dc.get(int, DoubleBuffer)public DoubleBuffer get(int index, DoubleBuffer buffer)
Matrix3dcDoubleBuffer starting at the specified
absolute buffer position/index using column-major order.
This method will not increment the position of the given DoubleBuffer.
get in interface Matrix3dcindex - the absolute position into the DoubleBufferbuffer - will receive the values of this matrix in column-major orderpublic FloatBuffer get(FloatBuffer buffer)
Matrix3dcFloatBuffer at the current
buffer position.
This method will not increment the position of the given FloatBuffer.
In order to specify the offset into the FloatBuffer at which
the matrix is stored, use Matrix3dc.get(int, FloatBuffer), taking
the absolute position as parameter.
Please note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into the given FloatBuffer.
get in interface Matrix3dcbuffer - will receive the values of this matrix in column-major order at its current positionMatrix3dc.get(int, FloatBuffer)public FloatBuffer get(int index, FloatBuffer buffer)
Matrix3dcFloatBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given FloatBuffer.
Please note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into the given FloatBuffer.
public ByteBuffer get(ByteBuffer buffer)
Matrix3dcByteBuffer at the current
buffer position.
This method will not increment the position of the given ByteBuffer.
In order to specify the offset into the ByteBuffer at which
the matrix is stored, use Matrix3dc.get(int, ByteBuffer), taking
the absolute position as parameter.
get in interface Matrix3dcbuffer - will receive the values of this matrix in column-major order at its current positionMatrix3dc.get(int, ByteBuffer)public ByteBuffer get(int index, ByteBuffer buffer)
Matrix3dcByteBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given ByteBuffer.
public ByteBuffer getFloats(ByteBuffer buffer)
Matrix3dcByteBuffer at the current
buffer position.
This method will not increment the position of the given ByteBuffer.
Please note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into the given ByteBuffer.
In order to specify the offset into the ByteBuffer at which
the matrix is stored, use Matrix3dc.getFloats(int, ByteBuffer), taking
the absolute position as parameter.
getFloats in interface Matrix3dcbuffer - will receive the elements of this matrix as float values in column-major order at its current positionMatrix3dc.getFloats(int, ByteBuffer)public ByteBuffer getFloats(int index, ByteBuffer buffer)
Matrix3dcByteBuffer
starting at the specified absolute buffer position/index.
This method will not increment the position of the given ByteBuffer.
Please note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into the given ByteBuffer.
public double[] get(double[] arr,
int offset)
Matrix3dcpublic double[] get(double[] arr)
Matrix3dc
In order to specify an explicit offset into the array, use the method Matrix3dc.get(double[], int).
get in interface Matrix3dcarr - the array to write the matrix values intoMatrix3dc.get(double[], int)public float[] get(float[] arr,
int offset)
Matrix3dcPlease note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into the given float array.
public float[] get(float[] arr)
Matrix3dcPlease note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into the given float array.
In order to specify an explicit offset into the array, use the method Matrix3dc.get(float[], int).
get in interface Matrix3dcarr - the array to write the matrix values intoMatrix3dc.get(float[], int)public Matrix3d set(DoubleBuffer buffer)
DoubleBuffer in column-major order,
starting at its current position.
The DoubleBuffer is expected to contain the values in column-major order.
The position of the DoubleBuffer will not be changed by this method.
buffer - the DoubleBuffer to read the matrix values from in column-major orderpublic Matrix3d set(FloatBuffer buffer)
FloatBuffer in column-major order,
starting at its current position.
The FloatBuffer is expected to contain the values in column-major order.
The position of the FloatBuffer will not be changed by this method.
buffer - the FloatBuffer to read the matrix values from in column-major orderpublic Matrix3d set(ByteBuffer buffer)
ByteBuffer in column-major order,
starting at its current position.
The ByteBuffer is expected to contain the values in column-major order.
The position of the ByteBuffer will not be changed by this method.
buffer - the ByteBuffer to read the matrix values from in column-major orderpublic Matrix3d setFloats(ByteBuffer buffer)
ByteBuffer in column-major order,
starting at its current position.
The ByteBuffer is expected to contain the values in column-major order.
The position of the ByteBuffer will not be changed by this method.
buffer - the ByteBuffer to read the matrix values from in column-major orderpublic Matrix3d set(Vector3dc col0, Vector3dc col1, Vector3dc col2)
col0 - the first columncol1 - the second columncol2 - the third columnpublic Matrix3d zero()
public Matrix3d identity()
public Matrix3d scaling(double factor)
The resulting matrix can be multiplied against another transformation matrix to obtain an additional scaling.
In order to post-multiply a scaling transformation directly to a
matrix, use scale() instead.
factor - the scale factor in x, y and zscale(double)public Matrix3d scaling(double x, double y, double z)
x - the scale in xy - the scale in yz - the scale in zpublic Matrix3d scaling(Vector3dc xyz)
xyz.x, xyz.y and xyz.z respectively.
The resulting matrix can be multiplied against another transformation matrix to obtain an additional scaling.
In order to post-multiply a scaling transformation directly to a
matrix use scale() instead.
xyz - the scale in x, y and z respectivelyscale(Vector3dc)public Matrix3d scale(Vector3dc xyz, Matrix3d dest)
Matrix3dcthis matrix by scaling the base axes by the given xyz.x,
xyz.y and xyz.z factors, respectively and store the result in dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be M * S. So when transforming a
vector v with the new matrix by using M * S * v
, the scaling will be applied first!
public Matrix3d scale(Vector3dc xyz)
xyz.x,
xyz.y and xyz.z factors, respectively.
If M is this matrix and S the scaling matrix,
then the new matrix will be M * S. So when transforming a
vector v with the new matrix by using M * S * v, the
scaling will be applied first!
xyz - the factors of the x, y and z component, respectivelypublic Matrix3d scale(double x, double y, double z, Matrix3d dest)
Matrix3dcdest.
If M is this matrix and S the scaling matrix,
then the new matrix will be M * S. So when transforming a
vector v with the new matrix by using M * S * v
, the scaling will be applied first!
public Matrix3d scale(double x, double y, double z)
If M is this matrix and S the scaling matrix,
then the new matrix will be M * S. So when transforming a
vector v with the new matrix by using M * S * v
, the scaling will be applied first!
x - the factor of the x componenty - the factor of the y componentz - the factor of the z componentpublic Matrix3d scale(double xyz, Matrix3d dest)
Matrix3dcxyz factor
and store the result in dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be M * S. So when transforming a
vector v with the new matrix by using M * S * v
, the scaling will be applied first!
scale in interface Matrix3dcxyz - the factor for all componentsdest - will hold the resultMatrix3dc.scale(double, double, double, Matrix3d)public Matrix3d scale(double xyz)
xyz factor.
If M is this matrix and S the scaling matrix,
then the new matrix will be M * S. So when transforming a
vector v with the new matrix by using M * S * v
, the scaling will be applied first!
xyz - the factor for all componentsscale(double, double, double)public Matrix3d scaleLocal(double x, double y, double z, Matrix3d dest)
Matrix3dcthis matrix by scaling the base axes by the given x,
y and z factors and store the result in dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be S * M. So when transforming a
vector v with the new matrix by using S * M * v
, the scaling will be applied last!
scaleLocal in interface Matrix3dcx - the factor of the x componenty - the factor of the y componentz - the factor of the z componentdest - will hold the resultpublic Matrix3d scaleLocal(double x, double y, double z)
If M is this matrix and S the scaling matrix,
then the new matrix will be S * M. So when transforming a
vector v with the new matrix by using S * M * v, the
scaling will be applied last!
x - the factor of the x componenty - the factor of the y componentz - the factor of the z componentpublic Matrix3d rotation(double angle, Vector3dc axis)
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
The resulting matrix can be multiplied against another transformation matrix to obtain an additional rotation.
In order to post-multiply a rotation transformation directly to a
matrix, use rotate() instead.
angle - the angle in radiansaxis - the axis to rotate about (needs to be normalized)rotate(double, Vector3dc)public Matrix3d rotation(double angle, Vector3fc axis)
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
The resulting matrix can be multiplied against another transformation matrix to obtain an additional rotation.
In order to post-multiply a rotation transformation directly to a
matrix, use rotate() instead.
angle - the angle in radiansaxis - the axis to rotate about (needs to be normalized)rotate(double, Vector3fc)public Matrix3d rotation(AxisAngle4f axisAngle)
AxisAngle4f.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
The resulting matrix can be multiplied against another transformation matrix to obtain an additional rotation.
In order to apply the rotation transformation to an existing transformation,
use rotate() instead.
Reference: http://en.wikipedia.org
axisAngle - the AxisAngle4f (needs to be normalized)rotate(AxisAngle4f)public Matrix3d rotation(AxisAngle4d axisAngle)
AxisAngle4d.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
The resulting matrix can be multiplied against another transformation matrix to obtain an additional rotation.
In order to apply the rotation transformation to an existing transformation,
use rotate() instead.
Reference: http://en.wikipedia.org
axisAngle - the AxisAngle4d (needs to be normalized)rotate(AxisAngle4d)public Matrix3d rotation(double angle, double x, double y, double z)
The axis described by the three components needs to be a unit vector.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
The resulting matrix can be multiplied against another transformation matrix to obtain an additional rotation.
In order to apply the rotation transformation to an existing transformation,
use rotate() instead.
Reference: http://en.wikipedia.org
angle - the angle in radiansx - the x-component of the rotation axisy - the y-component of the rotation axisz - the z-component of the rotation axisrotate(double, double, double, double)public Matrix3d rotationX(double ang)
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
Reference: http://en.wikipedia.org
ang - the angle in radianspublic Matrix3d rotationY(double ang)
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
Reference: http://en.wikipedia.org
ang - the angle in radianspublic Matrix3d rotationZ(double ang)
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
Reference: http://en.wikipedia.org
ang - the angle in radianspublic Matrix3d rotationXYZ(double angleX, double angleY, double angleZ)
angleX radians about the X axis, followed by a rotation
of angleY radians about the Y axis and followed by a rotation of angleZ radians about the Z axis.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
This method is equivalent to calling: rotationX(angleX).rotateY(angleY).rotateZ(angleZ)
angleX - the angle to rotate about XangleY - the angle to rotate about YangleZ - the angle to rotate about Zpublic Matrix3d rotationZYX(double angleZ, double angleY, double angleX)
angleZ radians about the Z axis, followed by a rotation
of angleY radians about the Y axis and followed by a rotation of angleX radians about the X axis.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
This method is equivalent to calling: rotationZ(angleZ).rotateY(angleY).rotateX(angleX)
angleZ - the angle to rotate about ZangleY - the angle to rotate about YangleX - the angle to rotate about Xpublic Matrix3d rotationYXZ(double angleY, double angleX, double angleZ)
angleY radians about the Y axis, followed by a rotation
of angleX radians about the X axis and followed by a rotation of angleZ radians about the Z axis.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
This method is equivalent to calling: rotationY(angleY).rotateX(angleX).rotateZ(angleZ)
angleY - the angle to rotate about YangleX - the angle to rotate about XangleZ - the angle to rotate about Zpublic Matrix3d rotation(Quaterniondc quat)
Quaterniondc.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
The resulting matrix can be multiplied against another transformation matrix to obtain an additional rotation.
In order to apply the rotation transformation to an existing transformation,
use rotate() instead.
Reference: http://en.wikipedia.org
quat - the Quaterniondcrotate(Quaterniondc)public Matrix3d rotation(Quaternionfc quat)
Quaternionfc.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
The resulting matrix can be multiplied against another transformation matrix to obtain an additional rotation.
In order to apply the rotation transformation to an existing transformation,
use rotate() instead.
Reference: http://en.wikipedia.org
quat - the Quaternionfcrotate(Quaternionfc)public Vector3d transform(Vector3d v)
Matrix3dcpublic Vector3d transform(Vector3dc v, Vector3d dest)
Matrix3dcdest.public Vector3f transform(Vector3f v)
Matrix3dcpublic Vector3f transform(Vector3fc v, Vector3f dest)
Matrix3dcdest.public Vector3d transform(double x, double y, double z, Vector3d dest)
Matrix3dc(x, y, z) by this matrix and store the result in dest.public Vector3d transformTranspose(Vector3d v)
Matrix3dctransformTranspose in interface Matrix3dcv - the vector to transformpublic Vector3d transformTranspose(Vector3dc v, Vector3d dest)
Matrix3dcdest.transformTranspose in interface Matrix3dcv - the vector to transformdest - will hold the resultpublic Vector3d transformTranspose(double x, double y, double z, Vector3d dest)
Matrix3dc(x, y, z) by the transpose of this matrix and store the result in dest.transformTranspose in interface Matrix3dcx - the x coordinate of the vector to transformy - the y coordinate of the vector to transformz - the z coordinate of the vector to transformdest - will hold the resultpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionpublic Matrix3d rotateX(double ang, Matrix3d dest)
Matrix3dcdest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v
, the rotation will be applied first!
Reference: http://en.wikipedia.org
public Matrix3d rotateX(double ang)
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v
, the rotation will be applied first!
Reference: http://en.wikipedia.org
ang - the angle in radianspublic Matrix3d rotateY(double ang, Matrix3d dest)
Matrix3dcdest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v
, the rotation will be applied first!
Reference: http://en.wikipedia.org
public Matrix3d rotateY(double ang)
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v
, the rotation will be applied first!
Reference: http://en.wikipedia.org
ang - the angle in radianspublic Matrix3d rotateZ(double ang, Matrix3d dest)
Matrix3dcdest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v
, the rotation will be applied first!
Reference: http://en.wikipedia.org
public Matrix3d rotateZ(double ang)
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v
, the rotation will be applied first!
Reference: http://en.wikipedia.org
ang - the angle in radianspublic Matrix3d rotateXYZ(double angleX, double angleY, double angleZ)
angleX radians about the X axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleZ radians about the Z axis.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
rotation will be applied first!
This method is equivalent to calling: rotateX(angleX).rotateY(angleY).rotateZ(angleZ)
angleX - the angle to rotate about XangleY - the angle to rotate about YangleZ - the angle to rotate about Zpublic Matrix3d rotateXYZ(double angleX, double angleY, double angleZ, Matrix3d dest)
Matrix3dcangleX radians about the X axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleZ radians about the Z axis and store the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
rotation will be applied first!
This method is equivalent to calling: rotateX(angleX, dest).rotateY(angleY).rotateZ(angleZ)
public Matrix3d rotateZYX(double angleZ, double angleY, double angleX)
angleZ radians about the Z axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleX radians about the X axis.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
rotation will be applied first!
This method is equivalent to calling: rotateZ(angleZ).rotateY(angleY).rotateX(angleX)
angleZ - the angle to rotate about ZangleY - the angle to rotate about YangleX - the angle to rotate about Xpublic Matrix3d rotateZYX(double angleZ, double angleY, double angleX, Matrix3d dest)
Matrix3dcangleZ radians about the Z axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleX radians about the X axis and store the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
rotation will be applied first!
This method is equivalent to calling: rotateZ(angleZ, dest).rotateY(angleY).rotateX(angleX)
public Matrix3d rotateYXZ(Vector3d angles)
angles.y radians about the Y axis, followed by a rotation of angles.x radians about the X axis and
followed by a rotation of angles.z radians about the Z axis.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
rotation will be applied first!
This method is equivalent to calling: rotateY(angles.y).rotateX(angles.x).rotateZ(angles.z)
angles - the Euler anglespublic Matrix3d rotateYXZ(double angleY, double angleX, double angleZ)
angleY radians about the Y axis, followed by a rotation of angleX radians about the X axis and
followed by a rotation of angleZ radians about the Z axis.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
rotation will be applied first!
This method is equivalent to calling: rotateY(angleY).rotateX(angleX).rotateZ(angleZ)
angleY - the angle to rotate about YangleX - the angle to rotate about XangleZ - the angle to rotate about Zpublic Matrix3d rotateYXZ(double angleY, double angleX, double angleZ, Matrix3d dest)
Matrix3dcangleY radians about the Y axis, followed by a rotation of angleX radians about the X axis and
followed by a rotation of angleZ radians about the Z axis and store the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
rotation will be applied first!
This method is equivalent to calling: rotateY(angleY, dest).rotateX(angleX).rotateZ(angleZ)
public Matrix3d rotate(double ang, double x, double y, double z)
The axis described by the three components needs to be a unit vector.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v
, the rotation will be applied first!
Reference: http://en.wikipedia.org
ang - the angle in radiansx - the x component of the axisy - the y component of the axisz - the z component of the axispublic Matrix3d rotate(double ang, double x, double y, double z, Matrix3d dest)
Matrix3dcdest.
The axis described by the three components needs to be a unit vector.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v
, the rotation will be applied first!
Reference: http://en.wikipedia.org
public Matrix3d rotateLocal(double ang, double x, double y, double z, Matrix3d dest)
(x, y, z) axis and store the result in dest.
The axis described by the three components needs to be a unit vector.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be R * M. So when transforming a
vector v with the new matrix by using R * M * v, the
rotation will be applied last!
In order to set the matrix to a rotation matrix without pre-multiplying the rotation
transformation, use rotation().
Reference: http://en.wikipedia.org
rotateLocal in interface Matrix3dcang - the angle in radiansx - the x component of the axisy - the y component of the axisz - the z component of the axisdest - will hold the resultrotation(double, double, double, double)public Matrix3d rotateLocal(double ang, double x, double y, double z)
(x, y, z) axis.
The axis described by the three components needs to be a unit vector.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be R * M. So when transforming a
vector v with the new matrix by using R * M * v, the
rotation will be applied last!
In order to set the matrix to a rotation matrix without pre-multiplying the rotation
transformation, use rotation().
Reference: http://en.wikipedia.org
ang - the angle in radiansx - the x component of the axisy - the y component of the axisz - the z component of the axisrotation(double, double, double, double)public Matrix3d rotateLocalX(double ang, Matrix3d dest)
dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be R * M. So when transforming a
vector v with the new matrix by using R * M * v, the
rotation will be applied last!
In order to set the matrix to a rotation matrix without pre-multiplying the rotation
transformation, use rotationX().
Reference: http://en.wikipedia.org
rotateLocalX in interface Matrix3dcang - the angle in radians to rotate about the X axisdest - will hold the resultrotationX(double)public Matrix3d rotateLocalX(double ang)
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be R * M. So when transforming a
vector v with the new matrix by using R * M * v, the
rotation will be applied last!
In order to set the matrix to a rotation matrix without pre-multiplying the rotation
transformation, use rotationX().
Reference: http://en.wikipedia.org
ang - the angle in radians to rotate about the X axisrotationX(double)public Matrix3d rotateLocalY(double ang, Matrix3d dest)
dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be R * M. So when transforming a
vector v with the new matrix by using R * M * v, the
rotation will be applied last!
In order to set the matrix to a rotation matrix without pre-multiplying the rotation
transformation, use rotationY().
Reference: http://en.wikipedia.org
rotateLocalY in interface Matrix3dcang - the angle in radians to rotate about the Y axisdest - will hold the resultrotationY(double)public Matrix3d rotateLocalY(double ang)
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be R * M. So when transforming a
vector v with the new matrix by using R * M * v, the
rotation will be applied last!
In order to set the matrix to a rotation matrix without pre-multiplying the rotation
transformation, use rotationY().
Reference: http://en.wikipedia.org
ang - the angle in radians to rotate about the Y axisrotationY(double)public Matrix3d rotateLocalZ(double ang, Matrix3d dest)
dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be R * M. So when transforming a
vector v with the new matrix by using R * M * v, the
rotation will be applied last!
In order to set the matrix to a rotation matrix without pre-multiplying the rotation
transformation, use rotationZ().
Reference: http://en.wikipedia.org
rotateLocalZ in interface Matrix3dcang - the angle in radians to rotate about the Z axisdest - will hold the resultrotationZ(double)public Matrix3d rotateLocalZ(double ang)
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and R the rotation matrix,
then the new matrix will be R * M. So when transforming a
vector v with the new matrix by using R * M * v, the
rotation will be applied last!
In order to set the matrix to a rotation matrix without pre-multiplying the rotation
transformation, use rotationY().
Reference: http://en.wikipedia.org
ang - the angle in radians to rotate about the Z axisrotationY(double)public Matrix3d rotateLocal(Quaterniondc quat, Matrix3d dest)
Quaterniondc to this matrix and store
the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and Q the rotation matrix obtained from the given quaternion,
then the new matrix will be Q * M. So when transforming a
vector v with the new matrix by using Q * M * v,
the quaternion rotation will be applied last!
In order to set the matrix to a rotation transformation without pre-multiplying,
use rotation(Quaterniondc).
Reference: http://en.wikipedia.org
rotateLocal in interface Matrix3dcquat - the Quaterniondcdest - will hold the resultrotation(Quaterniondc)public Matrix3d rotateLocal(Quaterniondc quat)
Quaterniondc to this matrix.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and Q the rotation matrix obtained from the given quaternion,
then the new matrix will be Q * M. So when transforming a
vector v with the new matrix by using Q * M * v,
the quaternion rotation will be applied last!
In order to set the matrix to a rotation transformation without pre-multiplying,
use rotation(Quaterniondc).
Reference: http://en.wikipedia.org
quat - the Quaterniondcrotation(Quaterniondc)public Matrix3d rotateLocal(Quaternionfc quat, Matrix3d dest)
Quaternionfc to this matrix and store
the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and Q the rotation matrix obtained from the given quaternion,
then the new matrix will be Q * M. So when transforming a
vector v with the new matrix by using Q * M * v,
the quaternion rotation will be applied last!
In order to set the matrix to a rotation transformation without pre-multiplying,
use rotation(Quaternionfc).
Reference: http://en.wikipedia.org
rotateLocal in interface Matrix3dcquat - the Quaternionfcdest - will hold the resultrotation(Quaternionfc)public Matrix3d rotateLocal(Quaternionfc quat)
Quaternionfc to this matrix.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and Q the rotation matrix obtained from the given quaternion,
then the new matrix will be Q * M. So when transforming a
vector v with the new matrix by using Q * M * v,
the quaternion rotation will be applied last!
In order to set the matrix to a rotation transformation without pre-multiplying,
use rotation(Quaternionfc).
Reference: http://en.wikipedia.org
quat - the Quaternionfcrotation(Quaternionfc)public Matrix3d rotate(Quaterniondc quat)
Quaterniondc to this matrix.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and Q the rotation matrix obtained from the given quaternion,
then the new matrix will be M * Q. So when transforming a
vector v with the new matrix by using M * Q * v,
the quaternion rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(Quaterniondc).
Reference: http://en.wikipedia.org
quat - the Quaterniondcrotation(Quaterniondc)public Matrix3d rotate(Quaterniondc quat, Matrix3d dest)
Quaterniondc to this matrix and store
the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and Q the rotation matrix obtained from the given quaternion,
then the new matrix will be M * Q. So when transforming a
vector v with the new matrix by using M * Q * v,
the quaternion rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(Quaterniondc).
Reference: http://en.wikipedia.org
rotate in interface Matrix3dcquat - the Quaterniondcdest - will hold the resultrotation(Quaterniondc)public Matrix3d rotate(Quaternionfc quat)
Quaternionfc to this matrix.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and Q the rotation matrix obtained from the given quaternion,
then the new matrix will be M * Q. So when transforming a
vector v with the new matrix by using M * Q * v,
the quaternion rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(Quaternionfc).
Reference: http://en.wikipedia.org
quat - the Quaternionfcrotation(Quaternionfc)public Matrix3d rotate(Quaternionfc quat, Matrix3d dest)
Quaternionfc to this matrix and store
the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and Q the rotation matrix obtained from the given quaternion,
then the new matrix will be M * Q. So when transforming a
vector v with the new matrix by using M * Q * v,
the quaternion rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(Quaternionfc).
Reference: http://en.wikipedia.org
rotate in interface Matrix3dcquat - the Quaternionfcdest - will hold the resultrotation(Quaternionfc)public Matrix3d rotate(AxisAngle4f axisAngle)
AxisAngle4f, to this matrix.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and A the rotation matrix obtained from the given AxisAngle4f,
then the new matrix will be M * A. So when transforming a
vector v with the new matrix by using M * A * v,
the AxisAngle4f rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(AxisAngle4f).
Reference: http://en.wikipedia.org
axisAngle - the AxisAngle4f (needs to be normalized)rotate(double, double, double, double),
rotation(AxisAngle4f)public Matrix3d rotate(AxisAngle4f axisAngle, Matrix3d dest)
AxisAngle4f and store the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and A the rotation matrix obtained from the given AxisAngle4f,
then the new matrix will be M * A. So when transforming a
vector v with the new matrix by using M * A * v,
the AxisAngle4f rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(AxisAngle4f).
Reference: http://en.wikipedia.org
rotate in interface Matrix3dcaxisAngle - the AxisAngle4f (needs to be normalized)dest - will hold the resultrotate(double, double, double, double),
rotation(AxisAngle4f)public Matrix3d rotate(AxisAngle4d axisAngle)
AxisAngle4d, to this matrix.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and A the rotation matrix obtained from the given AxisAngle4d,
then the new matrix will be M * A. So when transforming a
vector v with the new matrix by using M * A * v,
the AxisAngle4d rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(AxisAngle4d).
Reference: http://en.wikipedia.org
axisAngle - the AxisAngle4d (needs to be normalized)rotate(double, double, double, double),
rotation(AxisAngle4d)public Matrix3d rotate(AxisAngle4d axisAngle, Matrix3d dest)
AxisAngle4d and store the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and A the rotation matrix obtained from the given AxisAngle4d,
then the new matrix will be M * A. So when transforming a
vector v with the new matrix by using M * A * v,
the AxisAngle4d rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(AxisAngle4d).
Reference: http://en.wikipedia.org
rotate in interface Matrix3dcaxisAngle - the AxisAngle4d (needs to be normalized)dest - will hold the resultrotate(double, double, double, double),
rotation(AxisAngle4d)public Matrix3d rotate(double angle, Vector3dc axis)
The axis described by the axis vector needs to be a unit vector.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and A the rotation matrix obtained from the given angle and axis,
then the new matrix will be M * A. So when transforming a
vector v with the new matrix by using M * A * v,
the axis-angle rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(double, Vector3dc).
Reference: http://en.wikipedia.org
angle - the angle in radiansaxis - the rotation axis (needs to be normalized)rotate(double, double, double, double),
rotation(double, Vector3dc)public Matrix3d rotate(double angle, Vector3dc axis, Matrix3d dest)
dest.
The axis described by the axis vector needs to be a unit vector.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and A the rotation matrix obtained from the given axis and angle,
then the new matrix will be M * A. So when transforming a
vector v with the new matrix by using M * A * v,
the axis-angle rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(double, Vector3dc).
Reference: http://en.wikipedia.org
rotate in interface Matrix3dcangle - the angle in radiansaxis - the rotation axis (needs to be normalized)dest - will hold the resultrotate(double, double, double, double),
rotation(double, Vector3dc)public Matrix3d rotate(double angle, Vector3fc axis)
The axis described by the axis vector needs to be a unit vector.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and A the rotation matrix obtained from the given angle and axis,
then the new matrix will be M * A. So when transforming a
vector v with the new matrix by using M * A * v,
the axis-angle rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(double, Vector3fc).
Reference: http://en.wikipedia.org
angle - the angle in radiansaxis - the rotation axis (needs to be normalized)rotate(double, double, double, double),
rotation(double, Vector3fc)public Matrix3d rotate(double angle, Vector3fc axis, Matrix3d dest)
dest.
The axis described by the axis vector needs to be a unit vector.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and A the rotation matrix obtained from the given axis and angle,
then the new matrix will be M * A. So when transforming a
vector v with the new matrix by using M * A * v,
the axis-angle rotation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying,
use rotation(double, Vector3fc).
Reference: http://en.wikipedia.org
rotate in interface Matrix3dcangle - the angle in radiansaxis - the rotation axis (needs to be normalized)dest - will hold the resultrotate(double, double, double, double),
rotation(double, Vector3fc)public Vector3d getRow(int row, Vector3d dest) throws IndexOutOfBoundsException
Matrix3dcrow index, starting with 0.getRow in interface Matrix3dcrow - the row index in [0..2]dest - will hold the row componentsIndexOutOfBoundsException - if row is not in [0..2]public Matrix3d setRow(int row, Vector3dc src) throws IndexOutOfBoundsException
row index, starting with 0.row - the row index in [0..2]src - the row components to setIndexOutOfBoundsException - if row is not in [0..2]public Matrix3d setRow(int row, double x, double y, double z) throws IndexOutOfBoundsException
row index, starting with 0.row - the column index in [0..2]x - the first element in the rowy - the second element in the rowz - the third element in the rowIndexOutOfBoundsException - if row is not in [0..2]public Vector3d getColumn(int column, Vector3d dest) throws IndexOutOfBoundsException
Matrix3dccolumn index, starting with 0.getColumn in interface Matrix3dccolumn - the column index in [0..2]dest - will hold the column componentsIndexOutOfBoundsException - if column is not in [0..2]public Matrix3d setColumn(int column, Vector3dc src) throws IndexOutOfBoundsException
column index, starting with 0.column - the column index in [0..2]src - the column components to setIndexOutOfBoundsException - if column is not in [0..2]public Matrix3d setColumn(int column, double x, double y, double z) throws IndexOutOfBoundsException
column index, starting with 0.column - the column index in [0..2]x - the first element in the columny - the second element in the columnz - the third element in the columnIndexOutOfBoundsException - if column is not in [0..2]public double get(int column,
int row)
Matrix3dcpublic Matrix3d set(int column, int row, double value)
column - the colum index in [0..2]row - the row index in [0..2]value - the valuepublic Matrix3d normal()
this matrix to its own normal matrix.
Please note that, if this is an orthogonal matrix or a matrix whose columns are orthogonal vectors,
then this method need not be invoked, since in that case this itself is its normal matrix.
In this case, use set(Matrix3dc) to set a given Matrix3f to this matrix.
set(Matrix3dc)public Matrix3d normal(Matrix3d dest)
this matrix and store it into dest.
Please note that, if this is an orthogonal matrix or a matrix whose columns are orthogonal vectors,
then this method need not be invoked, since in that case this itself is its normal matrix.
In this case, use set(Matrix3dc) to set a given Matrix3d to this matrix.
normal in interface Matrix3dcdest - will hold the resultset(Matrix3dc)public Matrix3d lookAlong(Vector3dc dir, Vector3dc up)
-z point along dir.
If M is this matrix and L the lookalong rotation matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v, the
lookalong rotation transformation will be applied first!
In order to set the matrix to a lookalong transformation without post-multiplying it,
use setLookAlong().
dir - the direction in space to look alongup - the direction of 'up'lookAlong(double, double, double, double, double, double),
setLookAlong(Vector3dc, Vector3dc)public Matrix3d lookAlong(Vector3dc dir, Vector3dc up, Matrix3d dest)
-z point along dir
and store the result in dest.
If M is this matrix and L the lookalong rotation matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v, the
lookalong rotation transformation will be applied first!
In order to set the matrix to a lookalong transformation without post-multiplying it,
use setLookAlong().
lookAlong in interface Matrix3dcdir - the direction in space to look alongup - the direction of 'up'dest - will hold the resultlookAlong(double, double, double, double, double, double),
setLookAlong(Vector3dc, Vector3dc)public Matrix3d lookAlong(double dirX, double dirY, double dirZ, double upX, double upY, double upZ, Matrix3d dest)
-z point along dir
and store the result in dest.
If M is this matrix and L the lookalong rotation matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v, the
lookalong rotation transformation will be applied first!
In order to set the matrix to a lookalong transformation without post-multiplying it,
use setLookAlong()
lookAlong in interface Matrix3dcdirX - the x-coordinate of the direction to look alongdirY - the y-coordinate of the direction to look alongdirZ - the z-coordinate of the direction to look alongupX - the x-coordinate of the up vectorupY - the y-coordinate of the up vectorupZ - the z-coordinate of the up vectordest - will hold the resultsetLookAlong(double, double, double, double, double, double)public Matrix3d lookAlong(double dirX, double dirY, double dirZ, double upX, double upY, double upZ)
-z point along dir.
If M is this matrix and L the lookalong rotation matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v, the
lookalong rotation transformation will be applied first!
In order to set the matrix to a lookalong transformation without post-multiplying it,
use setLookAlong()
dirX - the x-coordinate of the direction to look alongdirY - the y-coordinate of the direction to look alongdirZ - the z-coordinate of the direction to look alongupX - the x-coordinate of the up vectorupY - the y-coordinate of the up vectorupZ - the z-coordinate of the up vectorsetLookAlong(double, double, double, double, double, double)public Matrix3d setLookAlong(Vector3dc dir, Vector3dc up)
-z
point along dir.
In order to apply the lookalong transformation to any previous existing transformation,
use lookAlong(Vector3dc, Vector3dc).
dir - the direction in space to look alongup - the direction of 'up'setLookAlong(Vector3dc, Vector3dc),
lookAlong(Vector3dc, Vector3dc)public Matrix3d setLookAlong(double dirX, double dirY, double dirZ, double upX, double upY, double upZ)
-z
point along dir.
In order to apply the lookalong transformation to any previous existing transformation,
use lookAlong()
dirX - the x-coordinate of the direction to look alongdirY - the y-coordinate of the direction to look alongdirZ - the z-coordinate of the direction to look alongupX - the x-coordinate of the up vectorupY - the y-coordinate of the up vectorupZ - the z-coordinate of the up vectorsetLookAlong(double, double, double, double, double, double),
lookAlong(double, double, double, double, double, double)public Vector3d getScale(Vector3d dest)
Matrix3dcthis matrix for the three base axes.public Vector3d positiveZ(Vector3d dir)
Matrix3dc+Z before the transformation represented by this matrix is applied.
This method is equivalent to the following code:
Matrix3d inv = new Matrix3d(this).invert(); inv.transform(dir.set(0, 0, 1)).normalize();If
this is already an orthogonal matrix, then consider using Matrix3dc.normalizedPositiveZ(Vector3d) instead.
Reference: http://www.euclideanspace.com
public Vector3d normalizedPositiveZ(Vector3d dir)
Matrix3dc+Z before the transformation represented by this orthogonal matrix is applied.
This method only produces correct results if this is an orthogonal matrix.
This method is equivalent to the following code:
Matrix3d inv = new Matrix3d(this).transpose(); inv.transform(dir.set(0, 0, 1));
Reference: http://www.euclideanspace.com
normalizedPositiveZ in interface Matrix3dcdir - will hold the direction of +Zpublic Vector3d positiveX(Vector3d dir)
Matrix3dc+X before the transformation represented by this matrix is applied.
This method is equivalent to the following code:
Matrix3d inv = new Matrix3d(this).invert(); inv.transform(dir.set(1, 0, 0)).normalize();If
this is already an orthogonal matrix, then consider using Matrix3dc.normalizedPositiveX(Vector3d) instead.
Reference: http://www.euclideanspace.com
public Vector3d normalizedPositiveX(Vector3d dir)
Matrix3dc+X before the transformation represented by this orthogonal matrix is applied.
This method only produces correct results if this is an orthogonal matrix.
This method is equivalent to the following code:
Matrix3d inv = new Matrix3d(this).transpose(); inv.transform(dir.set(1, 0, 0));
Reference: http://www.euclideanspace.com
normalizedPositiveX in interface Matrix3dcdir - will hold the direction of +Xpublic Vector3d positiveY(Vector3d dir)
Matrix3dc+Y before the transformation represented by this matrix is applied.
This method is equivalent to the following code:
Matrix3d inv = new Matrix3d(this).invert(); inv.transform(dir.set(0, 1, 0)).normalize();If
this is already an orthogonal matrix, then consider using Matrix3dc.normalizedPositiveY(Vector3d) instead.
Reference: http://www.euclideanspace.com
public Vector3d normalizedPositiveY(Vector3d dir)
Matrix3dc+Y before the transformation represented by this orthogonal matrix is applied.
This method only produces correct results if this is an orthogonal matrix.
This method is equivalent to the following code:
Matrix3d inv = new Matrix3d(this).transpose(); inv.transform(dir.set(0, 1, 0));
Reference: http://www.euclideanspace.com
normalizedPositiveY in interface Matrix3dcdir - will hold the direction of +Ypublic boolean equals(Matrix3dc m, double delta)
Matrix3dcthis matrix with the given matrix using the given delta
and return whether all of them are equal within a maximum difference of delta.
Please note that this method is not used by any data structure such as ArrayList HashSet or HashMap
and their operations, such as ArrayList.contains(Object) or HashSet.remove(Object), since those
data structures only use the Object.equals(Object) and Object.hashCode() methods.
public Matrix3d swap(Matrix3d other)
this matrix with the given other matrix.other - the other matrix to exchange the values withpublic Matrix3d add(Matrix3dc other)
this and other.other - the other addendpublic Matrix3d add(Matrix3dc other, Matrix3d dest)
Matrix3dcthis and other and store the result in dest.public Matrix3d sub(Matrix3dc subtrahend)
subtrahend from this.subtrahend - the subtrahendpublic Matrix3d sub(Matrix3dc subtrahend, Matrix3d dest)
Matrix3dcsubtrahend from this and store the result in dest.public Matrix3d mulComponentWise(Matrix3dc other)
this by other.other - the other matrixpublic Matrix3d mulComponentWise(Matrix3dc other, Matrix3d dest)
Matrix3dcthis by other and store the result in dest.mulComponentWise in interface Matrix3dcother - the other matrixdest - will hold the resultpublic Matrix3d setSkewSymmetric(double a, double b, double c)
0, a, -b -a, 0, c b, -c, 0Reference: https://en.wikipedia.org
a - the value used for the matrix elements m01 and m10b - the value used for the matrix elements m02 and m20c - the value used for the matrix elements m12 and m21public Matrix3d lerp(Matrix3dc other, double t)
this and other using the given interpolation factor t
and store the result in this.
If t is 0.0 then the result is this. If the interpolation factor is 1.0
then the result is other.
other - the other matrixt - the interpolation factor between 0.0 and 1.0public Matrix3d lerp(Matrix3dc other, double t, Matrix3d dest)
Matrix3dcthis and other using the given interpolation factor t
and store the result in dest.
If t is 0.0 then the result is this. If the interpolation factor is 1.0
then the result is other.
public Matrix3d rotateTowards(Vector3dc direction, Vector3dc up, Matrix3d dest)
+Z axis with direction
and store the result in dest.
If M is this matrix and L the lookat matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v,
the lookat transformation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying it,
use rotationTowards().
This method is equivalent to calling: mul(new Matrix3d().lookAlong(new Vector3d(dir).negate(), up).invert(), dest)
rotateTowards in interface Matrix3dcdirection - the direction to rotate towardsup - the model's up vectordest - will hold the resultrotateTowards(double, double, double, double, double, double, Matrix3d),
rotationTowards(Vector3dc, Vector3dc)public Matrix3d rotateTowards(Vector3dc direction, Vector3dc up)
+Z axis with direction.
If M is this matrix and L the lookat matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v,
the lookat transformation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying it,
use rotationTowards().
This method is equivalent to calling: mul(new Matrix3d().lookAlong(new Vector3d(dir).negate(), up).invert())
direction - the direction to orient towardsup - the up vectorrotateTowards(double, double, double, double, double, double),
rotationTowards(Vector3dc, Vector3dc)public Matrix3d rotateTowards(double dirX, double dirY, double dirZ, double upX, double upY, double upZ)
+Z axis with direction.
If M is this matrix and L the lookat matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v,
the lookat transformation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying it,
use rotationTowards().
This method is equivalent to calling: mul(new Matrix3d().lookAlong(-dirX, -dirY, -dirZ, upX, upY, upZ).invert())
dirX - the x-coordinate of the direction to rotate towardsdirY - the y-coordinate of the direction to rotate towardsdirZ - the z-coordinate of the direction to rotate towardsupX - the x-coordinate of the up vectorupY - the y-coordinate of the up vectorupZ - the z-coordinate of the up vectorrotateTowards(Vector3dc, Vector3dc),
rotationTowards(double, double, double, double, double, double)public Matrix3d rotateTowards(double dirX, double dirY, double dirZ, double upX, double upY, double upZ, Matrix3d dest)
+Z axis with dir
and store the result in dest.
If M is this matrix and L the lookat matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v,
the lookat transformation will be applied first!
In order to set the matrix to a rotation transformation without post-multiplying it,
use rotationTowards().
This method is equivalent to calling: mul(new Matrix3d().lookAlong(-dirX, -dirY, -dirZ, upX, upY, upZ).invert(), dest)
rotateTowards in interface Matrix3dcdirX - the x-coordinate of the direction to rotate towardsdirY - the y-coordinate of the direction to rotate towardsdirZ - the z-coordinate of the direction to rotate towardsupX - the x-coordinate of the up vectorupY - the y-coordinate of the up vectorupZ - the z-coordinate of the up vectordest - will hold the resultrotateTowards(Vector3dc, Vector3dc),
rotationTowards(double, double, double, double, double, double)public Matrix3d rotationTowards(Vector3dc dir, Vector3dc up)
-z axis with center - eye.
In order to apply the rotation transformation to a previous existing transformation,
use rotateTowards.
This method is equivalent to calling: setLookAlong(new Vector3d(dir).negate(), up).invert()
dir - the direction to orient the local -z axis towardsup - the up vectorrotationTowards(Vector3dc, Vector3dc),
rotateTowards(double, double, double, double, double, double)public Matrix3d rotationTowards(double dirX, double dirY, double dirZ, double upX, double upY, double upZ)
-z axis with center - eye.
In order to apply the rotation transformation to a previous existing transformation,
use rotateTowards.
This method is equivalent to calling: setLookAlong(-dirX, -dirY, -dirZ, upX, upY, upZ).invert()
dirX - the x-coordinate of the direction to rotate towardsdirY - the y-coordinate of the direction to rotate towardsdirZ - the z-coordinate of the direction to rotate towardsupX - the x-coordinate of the up vectorupY - the y-coordinate of the up vectorupZ - the z-coordinate of the up vectorrotateTowards(Vector3dc, Vector3dc),
rotationTowards(double, double, double, double, double, double)public Vector3d getEulerAnglesZYX(Vector3d dest)
this matrix and store the extracted Euler angles in dest.
This method assumes that this matrix only represents a rotation without scaling.
Note that the returned Euler angles must be applied in the order Z * Y * X to obtain the identical matrix.
This means that calling rotateZYX(double, double, double) using the obtained Euler angles will yield
the same rotation as the original matrix from which the Euler angles were obtained, so in the below code the matrix
m2 should be identical to m (disregarding possible floating-point inaccuracies).
Matrix3d m = ...; // <- matrix only representing rotation Matrix3d n = new Matrix3d(); n.rotateZYX(m.getEulerAnglesZYX(new Vector3d()));
Reference: http://nghiaho.com/
getEulerAnglesZYX in interface Matrix3dcdest - will hold the extracted Euler anglespublic Matrix3d obliqueZ(double a, double b)
a and
b.
If M is this matrix and O the oblique transformation matrix,
then the new matrix will be M * O. So when transforming a
vector v with the new matrix by using M * O * v, the
oblique transformation will be applied first!
The oblique transformation is defined as:
x' = x + a*z y' = y + a*z z' = zor in matrix form:
1 0 a 0 1 b 0 0 1
a - the value for the z factor that applies to xb - the value for the z factor that applies to ypublic Matrix3d obliqueZ(double a, double b, Matrix3d dest)
a and
b and store the result in dest.
If M is this matrix and O the oblique transformation matrix,
then the new matrix will be M * O. So when transforming a
vector v with the new matrix by using M * O * v, the
oblique transformation will be applied first!
The oblique transformation is defined as:
x' = x + a*z y' = y + a*z z' = zor in matrix form:
1 0 a 0 1 b 0 0 1
Copyright © 2015–2019 JOML. All rights reserved.