|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.math.geometry.AbstractRotation
com.kuka.math.geometry.AxisAngleRotation
public final class AxisAngleRotation
Immutable representation of a spatial rotation in axis-angle form.
According to Euler's rotation theorem every rotation of a body in three-dimensional space around a fixed point can be represented as a rotation around a fixed axis through that point.
The Robotics API always assumes the axis of the rotation to be given in [mm].
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
double |
getAngle()
Returns the angle of this rotation around its axis. |
Vector3D |
getAxis()
Returns the axis of this rotation. |
Matrix |
getMatrix()
Returns a matrix representing this rotation. |
int |
hashCode()
|
static AxisAngleRotation |
of(IRotation orig)
Returns a new immutable instance of this class from the value of the given rotation. |
static AxisAngleRotation |
of(Vector3D axis,
double angle)
Returns a new immutable instance of this class that represents a spatial rotation around the given axis through the given angle. |
String |
toString()
Returns a textual description of the rotation. |
String |
toString(NumberFormat fmt)
Returns a textual description of the rotation. |
AxisAngleRotation |
withAngle(double angle)
Returns a new instance (copy) of the rotation, with the angle replaced by the new value. |
AxisAngleRotation |
withAxis(Vector3D axis)
Returns a new instance (copy) of the rotation, with the rotation axis replaced by the new value. |
| Methods inherited from class com.kuka.math.geometry.AbstractRotation |
|---|
applyTo, applyTo, compose, invert, rotationalDistanceTo, rotationTo |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static AxisAngleRotation of(Vector3D axis,
double angle)
axis - The axis of the rotation. Doesn't need to be normalized.angle - the angle of the rotation around the axis in [rad]
public static AxisAngleRotation of(IRotation orig)
orig - the original rotation
public Vector3D getAxis()
public double getAngle()
public Matrix getMatrix()
IRotation
getMatrix in interface IRotationgetMatrix in class AbstractRotationMatrix representing this rotation. This is potentially
a costly conversionpublic AxisAngleRotation withAxis(Vector3D axis)
axis - the new axis the rotation
public AxisAngleRotation withAngle(double angle)
angle - the angle of the rotation around the axis in [rad]
public String toString()
This implementation will print the rotation as a tuple of the rotation axis as a vector and the rotation angle in
rad. The numerical values will be printed with the default format as returned by
MathUtils.getDefaultNumberFormat(). The following string can be regarded as typical:
([-1.55; 2.0; 0.8123], 1.5708)
toString in class AbstractRotationpublic String toString(NumberFormat fmt)
This implementation will print the rotation as a tuple of the rotation axis as a vector and the rotation angle in
rad. The numerical values will be printed using the NumberFormat.format(double) method of the given
formatter.
Example: The following code snippet, used on a given AxisAngleRotation rot
NumberFormat fmt = NumberFormat.getNumberInstance(Locale.US); fmt.setMinimumFractionDigits(1); fmt.setMaximumFractionDigits(3); System.out.println(rot.toString(fmt));might give the following output:
([-1.55; 2.0; 0.812], 1.571)
fmt - the NumberFormat used to format the number values
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||