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 27, 2014
- Author:
- Joseph A. Huwaldt Date: October 22, 2009
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
THETA
The index to the angular component of this axis angle rotation representation.static int
X
The index to the vector X component of this axis angle rotation representation's axis.static int
Y
The index to the vector Y component of this axis angle rotation representation's axis.static int
Z
The 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 AxisAngle
copy()
Returns a copy of this rotation transformallocated
by the calling thread (possibly on the stack).AxisAngle
divide(Rotation<?> that)
Returns the division of this rotation transform with the specified rotation transform.boolean
equals(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.int
hashCode()
Returns the hash code for this rotation.AxisAngle
times(Rotation<?> that)
Returns the product of this rotation transform with the specified rotation transform.DCMatrix
toDCM()
Returns a direction cosine transformation matrix from this axis/angle rotation.Quaternion
toQuaternion()
Returns a quaternion representing this rotation transformation.javolution.text.Text
toText()
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.AxisAngle
transpose()
Returns the spatial inverse of this transformation: AB rather than BA.static AxisAngle
valueOf(Rotation<?> transform)
Returns a newAxisAngle
instance constructed from the specified rotation transform.static AxisAngle
valueOf(Vector3D<?> axis, Parameter<javax.measure.quantity.Angle> angle)
Returns aAxisAngle
instance 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 aAxisAngle
instance 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 newAxisAngle
instance 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.
-
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:
toDCM
in 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:
toQuaternion
in 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 transformallocated
by the calling thread (possibly on the stack).
-
toText
public javolution.text.Text toText()
Returns the text representation of this rotation transform.- Specified by:
toText
in 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:
equals
in classjava.lang.Object
- Parameters:
obj
- the object to compare with.- Returns:
true
if this rotation is identical to that rotation;false
otherwise.
-
hashCode
public int hashCode()
Returns the hash code for this rotation.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hash code value.
-
-