Package chemaxon.struc
Class CTransform3D
java.lang.Object
chemaxon.struc.CTransform3D
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
3D transformation matrix.
- Since:
- Marvin 2.7, 02/05/2001
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptiondouble
The m00 element of the matrix.double
The m01 element of the matrix.double
The m02 element of the matrix.double
The m03 element of the matrix.double
The m10 element of the matrix.double
The m11 element of the matrix.double
The m12 element of the matrix.double
The m13 element of the matrix.double
The m20 element of the matrix.double
The m21 element of the matrix.double
The m22 element of the matrix.double
The m23 element of the matrix.double
The m30 element of the matrix.double
The m31 element of the matrix.double
The m32 element of the matrix.double
The m33 element of the matrix. -
Constructor Summary
ConstructorDescriptionConstructs an identity transformation.Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionclone()
final double
Computes the determinant of the matrix.final double
Computes the determinant of the 2D matrix.boolean
equals
(CTransform3D ct, double epsylon) boolean
final double[]
getEuler()
Gets the Euler angles from the rotation transformation.final double
getScale()
Gets the scale factor.int
hashCode()
final void
invert()
Inverts the matrix.boolean
is3d()
Tests whether the transformation is 3D.boolean
final void
Multiplies by another matrix from left.final void
mul
(CTransform3D b) Multiplies by another matrix from right.final void
Reads the 4x4 matrix components as double precision floating point numbers.final void
Reads the 4x4 matrix components as single precision floating point numbers.void
Deserializes a transformation matrix.void
set
(CTransform3D t) Copy.final void
setEuler
(double psi, double theta, double phi) Sets the rotational component using the Euler angles provided.final void
Makes identity transformation.final void
setRotation
(double nx, double ny, double nz, double phi) Sets the rotation components.final void
Sets the rotation center.final void
setScale
(double scale) Sets the scale factor.final void
setTranslation
(double x0, double y0, double z0) final void
final void
setZero()
Sets all components to zero.toString()
Gets a string representation of the matrix.final void
Transforms a point.final void
Writes the 4x4 matrix components as double precision floating point numbers.final void
Writes the 4x4 matrix components as single precision floating point numbers.void
Serializes a transformation matrix.
-
Field Details
-
m00
public transient double m00The m00 element of the matrix. -
m01
public transient double m01The m01 element of the matrix. -
m02
public transient double m02The m02 element of the matrix. -
m03
public transient double m03The m03 element of the matrix. -
m10
public transient double m10The m10 element of the matrix. -
m11
public transient double m11The m11 element of the matrix. -
m12
public transient double m12The m12 element of the matrix. -
m13
public transient double m13The m13 element of the matrix. -
m20
public transient double m20The m20 element of the matrix. -
m21
public transient double m21The m21 element of the matrix. -
m22
public transient double m22The m22 element of the matrix. -
m23
public transient double m23The m23 element of the matrix. -
m30
public transient double m30The m30 element of the matrix. -
m31
public transient double m31The m31 element of the matrix. -
m32
public transient double m32The m32 element of the matrix. -
m33
public transient double m33The m33 element of the matrix.
-
-
Constructor Details
-
CTransform3D
Copy constructor.- Parameters:
t
- the transformation to copy
-
CTransform3D
public CTransform3D()Constructs an identity transformation.
-
-
Method Details
-
set
Copy.- Parameters:
t
- target transformation
-
setZero
public final void setZero()Sets all components to zero.- Since:
- Marvin 4.1, 01/23/2006
-
setIdentity
public final void setIdentity()Makes identity transformation. -
getEuler
public final double[] getEuler()Gets the Euler angles from the rotation transformation.- Returns:
- array consisting of the 3 rotation angles about X, Y, Z
- Since:
- Marvin 4.1, 01/30/2006
-
setEuler
public final void setEuler(double psi, double theta, double phi) Sets the rotational component using the Euler angles provided. The other non-rotational elements are set as if this were an identity matrix. The euler parameters are three rotation angles applied first about the X, then Y, then Z axis.- Parameters:
psi
- rotation angle about X axistheta
- rotation angle about Y axisphi
- rotation angle about Z axis- Since:
- Marvin 4.1, 01/30/2006
-
getScale
public final double getScale()Gets the scale factor. The scale equals to (-1)^sgn(det(T))*|det(T)|^(1/3)- Returns:
- the scale factor
-
setScale
public final void setScale(double scale) Sets the scale factor.- Parameters:
scale
- the scale
-
determinant
public final double determinant()Computes the determinant of the matrix.- Returns:
- the determinant
- Since:
- Marvin 4.1, 01/12/2006
-
determinant2D
public final double determinant2D()Computes the determinant of the 2D matrix.- Returns:
- the determinant of the 2D matrix
- Since:
- Marvin 4.1, 01/12/2006
-
setRotation
public final void setRotation(double nx, double ny, double nz, double phi) Sets the rotation components.- Parameters:
nx
- normal vector xny
- normal vector ynz
- normal vector zphi
- angle
-
setRotationCenter
Sets the rotation center. This method can be called aftersetRotation
(order is important!) if a point other than the origin is meant to be the rotation center. It sets the translation vector in the fourth column (m03
,m13
andm23
) in such a way that pointo
will be the center of rotation specified by the upper left 3x3 components.- Parameters:
o
- the center
-
setTranslation
- Parameters:
p
- the translation
-
setTranslation
public final void setTranslation(double x0, double y0, double z0) - Parameters:
x0
- x translationy0
- y translationz0
- z translation
-
transform
Transforms a point.- Parameters:
p
- the point
-
mul
Multiplies by another matrix from right.- Parameters:
b
- the other matrix
-
leftMul
Multiplies by another matrix from left.- Parameters:
b
- the other matrix
-
is3d
public boolean is3d()Tests whether the transformation is 3D.- Returns:
- true if the transformation is 3D, false otherwise
- Since:
- Marvin 4.0.2, 11/04/2005
-
invert
public final void invert()Inverts the matrix. -
toString
Gets a string representation of the matrix. -
writeExternal
Serializes a transformation matrix.- Specified by:
writeExternal
in interfaceExternalizable
- Parameters:
out
- the object output stream- Throws:
IOException
- Since:
- 3.5, 11/02/2004
-
readExternal
Deserializes a transformation matrix.- Specified by:
readExternal
in interfaceExternalizable
- Parameters:
in
- the object input stream- Throws:
IOException
- Since:
- 3.5, 11/02/2004
-
write16doubles
Writes the 4x4 matrix components as double precision floating point numbers.- Parameters:
out
- the object output stream- Throws:
IOException
- Since:
- 3.5, 11/03/2004
-
read16doubles
Reads the 4x4 matrix components as double precision floating point numbers.- Parameters:
in
- the object input stream- Throws:
IOException
- Since:
- 3.5, 11/03/2004
-
write16floats
Writes the 4x4 matrix components as single precision floating point numbers.- Parameters:
out
- the object output stream- Throws:
IOException
- Since:
- 3.5, 11/03/2004
-
read16floats
Reads the 4x4 matrix components as single precision floating point numbers.- Parameters:
in
- the object input stream- Throws:
IOException
- Since:
- 3.5, 11/03/2004
-
isIdentity
public boolean isIdentity() -
equals
-
equals
-
hashCode
public int hashCode() -
clone
-