com.kuka.math.geometry
Class AbstractRotation

java.lang.Object
  extended by com.kuka.math.geometry.AbstractRotation
All Implemented Interfaces:
IRotation
Direct Known Subclasses:
AxisAngleRotation, EulerZyxRotation, MatrixRotation, Rotation

public abstract class AbstractRotation
extends Object
implements IRotation

Abstract representation of a rotation in 3-dimensional space. A rotation of some rigid body in space has three degrees of freedom. Coordinate systems can be regarded as rigid bodies.

By default all computations will be done on the MatrixRotation representation of the rotation.

If you want to implement your own Rotation class, you should derive it from AbstractRotation.

Note: When operating on AbstractRotation there is no guarantee that the type is immutable, unless you have explicitly converted it to an immutable type before.


Constructor Summary
AbstractRotation()
           
 
Method Summary
 Point3D applyTo(Point3D point)
          Applies this rotation to the given point, i.e. rotates the point around the origin of its coordinate system.
 Vector3D applyTo(Vector3D vector)
          Applies this rotation to the given vector.
 IRotation compose(IRotation other)
          If the rotations A and B are represented as matrices, then the effect of A.compose(B) is corresponding to the matrix multiplication A*B.
abstract  Matrix getMatrix()
          Returns a matrix representing this rotation.
 IRotation invert()
          Returns an inverted rotation, i.e. a rotation that reverses the effect of this one.
 double rotationalDistanceTo(IRotation other)
          Calculates the rotational distance from this rotation to the other rotation.
 IRotation rotationTo(IRotation other)
          Calculates the rotation needed to turn this rotation into the other rotation.
 String toString()
          Returns a textual description of the rotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractRotation

public AbstractRotation()
Method Detail

applyTo

public Vector3D applyTo(Vector3D vector)
Description copied from interface: IRotation
Applies this rotation to the given vector.

Specified by:
applyTo in interface IRotation
Parameters:
vector - the vector to be rotated
Returns:
a new rotated vector

applyTo

public Point3D applyTo(Point3D point)
Description copied from interface: IRotation
Applies this rotation to the given point, i.e. rotates the point around the origin of its coordinate system.

Specified by:
applyTo in interface IRotation
Parameters:
point - the point to be rotated around the origin of its coordinate system
Returns:
a new point

compose

public IRotation compose(IRotation other)
Description copied from interface: IRotation
If the rotations A and B are represented as matrices, then the effect of A.compose(B) is corresponding to the matrix multiplication A*B.

Specified by:
compose in interface IRotation
Parameters:
other - the rotation to combine with this one
Returns:
the combined rotation

invert

public IRotation invert()
Description copied from interface: IRotation
Returns an inverted rotation, i.e. a rotation that reverses the effect of this one.

Specified by:
invert in interface IRotation
Returns:
the inverted rotation.

toString

public String toString()
Returns a textual description of the rotation. The representation is subject to change.

This implementation will return a description in Euler Z-Y-X angles in [rad] with KUKA notation (A, B, C). The following string can be regarded as typical:

"[A=1.23 B=3.14 C=-0.13]"

Overrides:
toString in class Object
Returns:
a brief description of the rotation

rotationTo

public IRotation rotationTo(IRotation other)
Description copied from interface: IRotation
Calculates the rotation needed to turn this rotation into the other rotation. The following holds true:

rot1.compose(rot1.rotationTo(rot2)) is equal to rot2

Specified by:
rotationTo in interface IRotation
Parameters:
other - another rotation
Returns:
the difference rotation between this and the other rotation.

rotationalDistanceTo

public double rotationalDistanceTo(IRotation other)
Description copied from interface: IRotation
Calculates the rotational distance from this rotation to the other rotation. The rotational distance is the angle of the corresponding AxisAngleRotation which turns this rotation into the other rotation.

Use this function to compare two rotations.

Specified by:
rotationalDistanceTo in interface IRotation
Parameters:
other - another rotation
Returns:
the positive rotational distance to the other rotation, in the range 0 to pi.

getMatrix

public abstract Matrix getMatrix()
Description copied from interface: IRotation
Returns a matrix representing this rotation. This is potentially a costly conversion.

Specified by:
getMatrix in interface IRotation
Returns:
a Matrix representing this rotation. This is potentially a costly conversion


Copyright © 2019. All rights reserved.