com.kuka.math.geometry
Class EulerZyxRotation

java.lang.Object
  extended by com.kuka.math.geometry.AbstractRotation
      extended by com.kuka.math.geometry.EulerZyxRotation
All Implemented Interfaces:
IRotation

public final class EulerZyxRotation
extends AbstractRotation

Immutable representation of a spatial rotation as Z-Y-X Euler angles, which are the same as X-Y-Z fixed angles.

Note: The angles α (alpha), β (beta), γ (gamma) are the same as the angles A, B, C in KUKA notation, respectively.

Note: The designations are the same as those used by J. J. Craig in "Introduction to Robotics".


Field Summary
static EulerZyxRotation NONE
          Immutable EulerZyxRotation instance representing no rotation.
 
Method Summary
 boolean equals(Object obj)
           
 double getAlphaRad()
          Returns the α (alpha) angle of the rotation in [rad].
 double getBetaRad()
          Returns the β (beta) angle of the rotation in [rad].
 double getGammaRad()
          Returns the γ (gamma) angle of the rotation in [rad].
 Matrix getMatrix()
          Returns a matrix representing this rotation.
 int hashCode()
           
static EulerZyxRotation of(IRotation orig)
          Returns an immutable instance from the values of the provided rotation.
static EulerZyxRotation ofDeg(double alpha, double beta, double gamma)
          Returns an immutable EulerZyxRotation instance with the given angle values.
static EulerZyxRotation ofRad(double alpha, double beta, double gamma)
          Returns an immutable EulerZyxRotation instance with the given angle values.
 String toString()
          Returns a textual description of the rotation.
 String toString(NumberFormat fmt)
          Returns a textual description of the rotation.
 EulerZyxRotation withAlphaRad(double value)
          Returns a new instance (copy) of the rotation, with the α (alpha) angle replaced by the new value.
 EulerZyxRotation withBetaRad(double value)
          Returns a new instance (copy) of the rotation, with the β (beta) angle replaced by the new value.
 EulerZyxRotation withGammaRad(double value)
          Returns a new instance (copy) of the rotation, with the γ (gamma) angle 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
 

Field Detail

NONE

public static final EulerZyxRotation NONE
Immutable EulerZyxRotation instance representing no rotation.

Method Detail

ofRad

public static EulerZyxRotation ofRad(double alpha,
                                     double beta,
                                     double gamma)
Returns an immutable EulerZyxRotation instance with the given angle values.

Parameters:
alpha - the α (alpha) angle of the rotation in [rad]. Note: This is the same as the angle A in KUKA notation.
beta - the β (beta) angle of the rotation in [rad]. Note: This is the same as the angle B in KUKA notation.
gamma - the γ (gamma) angle of the rotation in [rad]. Note: This is the same as the angle C in KUKA notation.
Returns:
an immutable EulerZyxRotation instance

ofDeg

public static EulerZyxRotation ofDeg(double alpha,
                                     double beta,
                                     double gamma)
Returns an immutable EulerZyxRotation instance with the given angle values.

Parameters:
alpha - the α (alpha) angle of the rotation in degrees. Note: This is the same as the angle A in KUKA notation.
beta - the β (beta) angle of the rotation in degrees. Note: This is the same as the angle B in KUKA notation.
gamma - the γ (gamma) angle of the rotation in degrees. Note: This is the same as the angle C in KUKA notation.
Returns:
an immutable EulerZyxRotation instance

of

public static EulerZyxRotation of(IRotation orig)
Returns an immutable instance from the values of the provided rotation. The internal calculations have a limited precision.

Parameters:
orig - the instance from which to take over the rotation
Returns:
an immutable instance

getAlphaRad

public double getAlphaRad()
Returns the α (alpha) angle of the rotation in [rad].

Note: This is the same as the angle A in KUKA notation.

Returns:
the α (alpha) angle of the rotation in [rad].

getBetaRad

public double getBetaRad()
Returns the β (beta) angle of the rotation in [rad].

Note: This is the same as the angle B in KUKA notation.

Returns:
the β (beta) angle of the rotation in [rad].

getGammaRad

public double getGammaRad()
Returns the γ (gamma) angle of the rotation in [rad].

Note: This is the same as the angle C in KUKA notation.

Returns:
the γ (gamma) angle of the rotation in [rad].

getMatrix

public 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
Specified by:
getMatrix in class AbstractRotation
Returns:
a Matrix representing this rotation. This is potentially a costly conversion

withAlphaRad

public EulerZyxRotation withAlphaRad(double value)
Returns a new instance (copy) of the rotation, with the α (alpha) angle replaced by the new value.

Parameters:
value - the α (alpha) angle of the rotation in [rad]. Note: This is the same as the angle A in KUKA notation.
Returns:
a new instance of the class

withBetaRad

public EulerZyxRotation withBetaRad(double value)
Returns a new instance (copy) of the rotation, with the β (beta) angle replaced by the new value.

Parameters:
value - the β (beta) angle of the rotation in [rad]. Note: This is the same as the angle B in KUKA notation.
Returns:
a new instance of the class

withGammaRad

public EulerZyxRotation withGammaRad(double value)
Returns a new instance (copy) of the rotation, with the γ (gamma) angle replaced by the new value.

Parameters:
value - the γ (gamma) angle of the rotation in [rad]. Note: This is the same as the angle C in KUKA notation.
Returns:
a new instance of the class

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

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

This implementation will print all angle values 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:

[A=0.0 B=3.14159 C=0.0]

Overrides:
toString in class AbstractRotation
Returns:
a textual description of the rotation with angle values in rad

toString

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

This implementation will print all angle values 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 EulerZyxRotation rot

 NumberFormat fmt = NumberFormat.getNumberInstance(Locale.US);
 fmt.setMinimumFractionDigits(1);
 fmt.setMaximumFractionDigits(3);
 System.out.println(rot.toString(fmt));
might give the following output:
 [A=1.235 B=3.142 C=0.0]

Parameters:
fmt - the NumberFormat used to format the number values
Returns:
a textual description of the rotation with angle values in rad


Copyright © 2019. All rights reserved.