public class RotationMatrix extends Object implements Serializable
Constructor and Description |
---|
RotationMatrix(cern.colt.matrix.DoubleMatrix2D matrix)
Creates a rotation-matrix from an existing
DoubleMatrix2D . |
RotationMatrix(int numberDimensions)
Creates a rotation-matrix populated only with zeros.
|
Modifier and Type | Method and Description |
---|---|
Point3d |
column(int columnIndex)
Extracts a column from the rotation-matrix as a point.
|
RotationMatrix |
duplicate()
Deep-copy of the current rotation-matrix.
|
cern.colt.matrix.DoubleMatrix2D |
getMatrix()
The underlying matrix used internally in the rotation-matrix.
|
int |
getNumberDimensions()
The number of dimensions in the rotation-matrix.
|
void |
multiplyByConstant(double value)
Multiplies each element in the rotation-matrix by a value.
|
Point3d |
rotatePoint(Tuple3d point)
Performs a rotation on a single point, encoded as a
Point3d . |
void |
rotatePointInplace(Point3d point)
Performs a rotation on a single point, replacing the existing value of the point.
|
String |
toString() |
RotationMatrix |
transpose()
Transposes the matrix immutably.
|
public RotationMatrix(int numberDimensions)
numberDimensions
- the dimensionality of the matrix to create.public RotationMatrix(cern.colt.matrix.DoubleMatrix2D matrix)
DoubleMatrix2D
.matrix
- the matrix, which is then used internally in the structure.public Point3d rotatePoint(Tuple3d point)
Point3d
.
The existing value of Point3d
remains unmodified.
point
- the point to rotate.public void rotatePointInplace(Point3d point)
point
- the point to rotate, and to which the rotated point's value is assigned.public Point3d column(int columnIndex) throws OperationFailedException
This should only be called on a three-dimensional rotation matrix.
columnIndex
- the index of the column.OperationFailedException
- if the rotation-matrix does not have three dimensions
exactly.public int getNumberDimensions()
public cern.colt.matrix.DoubleMatrix2D getMatrix()
RotationMatrix
.public void multiplyByConstant(double value)
value
- the value to multiply each element by.public RotationMatrix transpose()
RotationMatrix
that is a transposed copy.public RotationMatrix duplicate()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.