Package jahuwaldt.js.param
Class AxisAngle
- java.lang.Object
-
- jahuwaldt.js.param.AbstractRotation<AxisAngle>
-
- jahuwaldt.js.param.AxisAngle
-
- All Implemented Interfaces:
Rotation<AxisAngle>,java.io.Serializable,javolution.lang.Immutable,javolution.lang.Realtime,javolution.lang.ValueType,javolution.xml.XMLSerializable
public final class AxisAngle extends AbstractRotation<AxisAngle> implements javolution.xml.XMLSerializable
This class represents a rotation axis and rotation angle made up of Float64 elements. AxisAngles may be used to represents a relative orientation (attitude or rotation transformation) between two different reference frames; B wrt A or BA. It can be used to transform coordinates in reference frame A to reference frame B (A2B).
Reference: Wikipedia: Axis angle
Modified by: Joseph A. Huwaldt
- Version:
- February 23, 2025
- Author:
- Joseph A. Huwaldt Date: October 22, 2009
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intTHETAThe index to the angular component of this axis angle rotation representation.static intXThe index to the vector X component of this axis angle rotation representation's axis.static intYThe index to the vector Y component of this axis angle rotation representation's axis.static intZThe index to the vector Z component of this axis angle rotation representation's axis.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AxisAnglecopy()Returns a copy of this rotation transformallocatedby the calling thread (possibly on the stack).AxisAngledivide(Rotation<?> that)Returns the division of this rotation transform with the specified rotation transform.booleanequals(java.lang.Object obj)Compares this AxisAngle against the specified object for strict equality (same rotation type and same values).Parameter<javax.measure.quantity.Angle>getAngle()Return the rotation angle.Vector3D<javax.measure.quantity.Dimensionless>getAxis()Returns the rotation axis part of this axis/angle rotation transformation as a unit vector.inthashCode()Returns the hash code for this rotation.AxisAngletimes(Rotation<?> that)Returns the product of this rotation transform with the specified rotation transform.DCMatrixtoDCM()Returns a direction cosine transformation matrix from this axis/angle rotation.QuaterniontoQuaternion()Returns a quaternion representing this rotation transformation.javolution.text.TexttoText()Returns the text representation of this rotation transform.<Q extends javax.measure.quantity.Quantity>
Vector3D<Q>transform(Coordinate3D<Q> v)Transforms a 3D vector from frame A to B using this axis/angle rotation.AxisAngletranspose()Returns the spatial inverse of this transformation: AB rather than BA.static AxisAnglevalueOf(Rotation<?> transform)Returns a newAxisAngleinstance constructed from the specified rotation transform.static AxisAnglevalueOf(Vector3D<?> axis, Parameter<javax.measure.quantity.Angle> angle)Returns aAxisAngleinstance containing the specified rotation axis and rotation angle.-
Methods inherited from class jahuwaldt.js.param.AbstractRotation
getEulerTM, getPsiThetaTM, getPsiThetaTM, isApproxEqual, toString
-
-
-
-
Field Detail
-
X
public static final int X
The index to the vector X component of this axis angle rotation representation's axis.- See Also:
- Constant Field Values
-
Y
public static final int Y
The index to the vector Y component of this axis angle rotation representation's axis.- See Also:
- Constant Field Values
-
Z
public static final int Z
The index to the vector Z component of this axis angle rotation representation's axis.- See Also:
- Constant Field Values
-
THETA
public static final int THETA
The index to the angular component of this axis angle rotation representation.- See Also:
- Constant Field Values
-
-
Method Detail
-
valueOf
public static AxisAngle valueOf(Vector3D<?> axis, Parameter<javax.measure.quantity.Angle> angle)
Returns aAxisAngleinstance containing the specified rotation axis and rotation angle.- Parameters:
axis- The vector representing the rotation axis direction.angle- The rotation angle about the rotation axis.- Returns:
- The axis/angle rotation transformation having the specified values.
-
valueOf
public static AxisAngle valueOf(Rotation<?> transform)
Returns a newAxisAngleinstance constructed from the specified rotation transform.- Parameters:
transform- The Rotation transform to convert to a new quaternion.- Returns:
- the quaternion representing the specified attitude transform.
-
getAxis
public Vector3D<javax.measure.quantity.Dimensionless> getAxis()
Returns the rotation axis part of this axis/angle rotation transformation as a unit vector.- Returns:
- The rotation axis part of this axis/angle rotation transformation as a unit vector.
-
getAngle
public Parameter<javax.measure.quantity.Angle> getAngle()
Return the rotation angle.- Returns:
- the rotation angle parameter.
-
transpose
public AxisAngle transpose()
Returns the spatial inverse of this transformation: AB rather than BA.
-
times
public AxisAngle times(Rotation<?> that)
Returns the product of this rotation transform with the specified rotation transform. If this axis/angle rotation is BA and that is AC then the returned value is: BC = BA times AC (or C2B = A2B times C2A).
-
divide
public AxisAngle divide(Rotation<?> that)
Returns the division of this rotation transform with the specified rotation transform.- Parameters:
that- the rotation transform divisor.- Returns:
this / that
-
transform
public <Q extends javax.measure.quantity.Quantity> Vector3D<Q> transform(Coordinate3D<Q> v)
Transforms a 3D vector from frame A to B using this axis/angle rotation.
-
toDCM
public DCMatrix toDCM()
Returns a direction cosine transformation matrix from this axis/angle rotation.- Specified by:
toDCMin interfaceRotation<AxisAngle>- Returns:
- a direction cosine matrix that converts from frame A to B.
- See Also:
- Wikipedia: Rotation Matrix-AxisAngle
-
toQuaternion
public Quaternion toQuaternion()
Returns a quaternion representing this rotation transformation.- Specified by:
toQuaternionin interfaceRotation<AxisAngle>- Returns:
- a quaternion that converts from frame A to B.
- See Also:
- Wikipedia: AxisAngle
-
copy
public AxisAngle copy()
Returns a copy of this rotation transformallocatedby the calling thread (possibly on the stack).
-
toText
public javolution.text.Text toText()
Returns the text representation of this rotation transform.- Specified by:
toTextin interfacejavolution.lang.Realtime- Returns:
- the text representation of this rotation transform.
-
equals
public boolean equals(java.lang.Object obj)
Compares this AxisAngle against the specified object for strict equality (same rotation type and same values).- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to compare with.- Returns:
trueif this rotation is identical to that rotation;falseotherwise.
-
hashCode
public int hashCode()
Returns the hash code for this rotation.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code value.
-
-