public class Rotations
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Vector3D |
X_AXIS |
static Vector3D |
Y_AXIS |
static Vector3D |
Z_AXIS |
Constructor and Description |
---|
Rotations() |
Modifier and Type | Method and Description |
---|---|
static RealMatrix |
getRotMat(double[] r,
double theta)
Computes the rotation matrix that rotates by angle theta about axis r =
(rx, ry, rz).
|
static RealMatrix |
getRotMat(double alpha,
double beta,
double theta)
Computes the rotation matrix that rotates by angle theta about axis
(alpha, beta).
|
static RealMatrix |
getRotMat(Vector3D r,
double theta)
Computes the rotation matrix that rotates by angle theta about axis
r = (rx, ry, rz).
|
static RealMatrix |
getRotMat(Vector3D vec,
Vector3D targetAxis)
Get rotation matrix of one vector onto another vector.
|
static RealMatrix |
randomRotMat()
Generates a random rotation matrix with random seed taken from the clock
time.
|
static RealMatrix |
randomRotMat(int seed)
Generates a seeded random rotation matrix.
|
static RealMatrix |
randomRotMat(java.util.Random r)
Generates a random rotation matrix drawing using the random number
generator provided.
|
static DT |
rotateTensor(DT original,
Vector3D newE1)
Rotate a tensor so that it's e1 is aligned with vector.
|
static Vector3D |
rotateVector(Vector3D original,
RealMatrix rot)
Apply a rotation matric to a vector.
|
static Vector3D |
rotateVector(Vector3D original,
Vector3D axis,
double theta)
Rotate original by angle theta about axis.
|
static double[] |
transformPoint(RealMatrix mat,
double[] point)
Applies a 3D transformation matrix to a point.
|
public static final Vector3D X_AXIS
public static final Vector3D Y_AXIS
public static final Vector3D Z_AXIS
public static RealMatrix getRotMat(double alpha, double beta, double theta)
alpha
- Axis angle of colatitude.beta
- Axis angle of longitudetheta
- Angle of rotation.public static RealMatrix getRotMat(double[] r, double theta)
r
- The axis of rotation.theta
- The angle of rotation.public static RealMatrix getRotMat(Vector3D r, double theta)
r
- The axis of rotation.theta
- The angle of rotation.public static RealMatrix randomRotMat()
public static RealMatrix randomRotMat(int seed)
seed
- The random number generator seed.public static RealMatrix randomRotMat(java.util.Random r)
r
- The random number generator.public static double[] transformPoint(RealMatrix mat, double[] point)
mat
- The rotation matrix.point
- The point to be rotated.public static DT rotateTensor(DT original, Vector3D newE1)
original
- the tensor to be rotated.newE1
- a unit vector. The returned tensor's e1 will lie along this vector.public static Vector3D rotateVector(Vector3D original, Vector3D axis, double theta)
original
- the vector to be rotated.axis
- the axis of rotation. This should be a unit vector.theta
- the angle of rotation, in radians.public static Vector3D rotateVector(Vector3D original, RealMatrix rot)
public static RealMatrix getRotMat(Vector3D vec, Vector3D targetAxis)
vec
- the vector to be rotated.targetAxis
- the target unit vector. The returned matrix will transform vec
onto targetAxis
.