|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.matrix.AxisAngle
public class 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. |
static AxisAngle |
IDENTITY
|
static AxisAngle |
ROT_X_90
|
Constructor Summary | |
---|---|
AxisAngle()
Creates an AxisAngle and initializes it to the identity rotation. |
|
AxisAngle(AxisAngle axisAng)
Creates an AxisAngle and initializes it from an existing AxisAngle. |
|
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(RotationMatrix3d R)
Creates an AxisAngle initialized to the specified rotation matrix. |
|
AxisAngle(Vector3d axis,
double ang)
Creates an AxisAngle and sets it to the prescribed values. |
Method Summary | |
---|---|
boolean |
epsilonEquals(AxisAngle axisAng,
double eps)
Returns true if the elements of this AxisAngle equal those of another AxisAngle within a prescribed tolerance epsilon . |
boolean |
equals(AxisAngle axisAng)
Returns true if the elements of this AxisAngle equal those of another AxisAngle exactly. |
boolean |
equals(java.lang.Object obj)
Returns true if the supplied object is an AxisAngle and its elements equal those of this AxisAngle exactly. |
void |
get(double[] values)
Gets the values associated with this AxisAngle. |
void |
set(AxisAngle axisAng)
Sets this AxisAngle to the values of another AxisAngle. |
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 |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static AxisAngle IDENTITY
public static AxisAngle ROT_X_90
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)public AxisAngle(AxisAngle axisAng)
axisAng
- AxisAngle to supply initial valuespublic AxisAngle(RotationMatrix3d R)
R
- rotation matrixMethod 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(AxisAngle axisAng)
axisAng
- AxisAngle supplying new valuespublic void set(RotationMatrix3d R)
R
- rotation matrixpublic void set(Quaternion q)
q
- quaternionpublic void get(double[] values)
values
- returns the AxisAngle values. 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 java.lang.String toString()
toString
in class java.lang.Object
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
public boolean epsilonEquals(AxisAngle axisAng, double eps) throws ImproperSizeException
epsilon
.
axisAng
- AxisAngle to compare witheps
- comparison tolerance
ImproperSizeException
public boolean equals(AxisAngle axisAng)
axisAng
- AxisAngle to compare with
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Object to compare with
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |