|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.matrix.AxisAngle
Axis-angle representation of a rigid-body rotation. Any spatial rotation can be represented as a rotation about a specific axis by a certain angular amount. An angle of 0 corresponds to the "identity" rotation (i.e., no rotation).
In order to keep the representation unique, the axis is normalized and the angle is kept in the range 0 <= angle < Math.PI.
Field Summary | |
double |
angle
Angle of rotation about the axis, in radians. |
Vector3d |
axis
Rotation axis. |
Constructor Summary | |
AxisAngle()
Creates an AxisAngle and initializes it to the identity rotation. |
|
AxisAngle(double[] values)
Creates an AxisAngle and initializes it to the prescribed values. |
|
AxisAngle(double x,
double y,
double z,
double ang)
Creates an AxisAngle and initializes it to the prescribed values. |
|
AxisAngle(Vector3d axis,
double ang)
Creates an AxisAngle and sets it to the prescribed values. |
Method Summary | |
void |
set(double[] values)
Sets this AxisAngle to the prescribed values. |
void |
set(double x,
double y,
double z,
double ang)
Sets this AxisAngle to the prescribed values. |
void |
set(Quaternion q)
Sets this AxisAngle to the values appropriate for the specified quaternion. |
void |
set(RotationMatrix3d R)
Sets this AxisAngle to the values appropriate for the specified rotation matrix. |
void |
set(Vector3d axis,
double ang)
Sets this AxisAngle to the prescribed values. |
java.lang.String |
toString()
Returns a String representation of this AxisAngle, consisting of the x, y, and z components of the axis, followed by the angle (in radians). |
java.lang.String |
toString(NumberFormat fmt)
Returns a String representation of this AxisAngle, consisting of the x, y, and z components of the axis, followed by the angle (in radians). |
java.lang.String |
toString(java.lang.String fmtStr)
Returns a String representation of this AxisAngle, consisting of the x, y, and z components of the axis, followed by the angle (in radians). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public Vector3d axis
public double angle
Constructor Detail |
public AxisAngle()
public AxisAngle(double[] values)
values
- AxisAngle values given as an array. The x, y, and z
directions of the rotation axis are given by elements 0 through 2,
and the rotation angle (in radians) is given by element 3.public AxisAngle(double x, double y, double z, double ang)
x
- rotation axis x directiony
- rotation axis y directionz
- rotation axis z directionang
- rotation angle, in radianspublic AxisAngle(Vector3d axis, double ang)
axis
- rotation axisang
- rotation angle (in radians)Method Detail |
public void set(double x, double y, double z, double ang)
x
- rotation axis x directiony
- rotation axis y directionz
- rotation axis z directionang
- rotation angle, in radianspublic void set(double[] values)
values
- AxisAngle values given as an array. The x, y, and z
directions of the rotation axis are given by elements 0 through 2,
and the rotation angle (in radians) is given by element 3.public void set(Vector3d axis, double ang)
axis
- rotation axisang
- rotation angle (in radians)public void set(RotationMatrix3d R)
R
- rotation matrixpublic void set(Quaternion q)
q
- quaternionpublic java.lang.String toString()
public java.lang.String toString(java.lang.String fmtStr)
printf
style format string. For a description of the format string syntax,
see NumberFormat
.
fmtStr
- numeric format specification
public java.lang.String toString(NumberFormat fmt)
printf
style as decribed by the parameter NumberFormat
. When
called numerous times, this routine can be more efficient than
toString(String)
, because the NumberFormat
does not need to be
recreated each time from a specification string.
fmt
- numeric format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |