Class Direction3d

java.lang.Object
org.opentrafficsim.core.math.Direction3d

public class Direction3d extends Object
3D-rotation, RPY coded (longitudinal roll along the x-axis, lateral pitch along the y-axis and vertical yaw along the z-axis), also called Tait–Bryan angles or Cardan angles. Angles are absolute and relate to the absolute XYZ-frame of the world.

Copyright (c) 2013-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers
  • Constructor Summary

    Constructors
    Constructor
    Description
    Direction3d(double roll, double pitch, double yaw, DirectionUnit unit)
    Constructor.
    Direction3d(org.djunits.value.vdouble.scalar.Direction roll, org.djunits.value.vdouble.scalar.Direction pitch, org.djunits.value.vdouble.scalar.Direction yaw)
    Constructor.
    Direction3d(org.djunits.value.vdouble.vector.DirectionVector rotation)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    final org.djunits.value.vdouble.scalar.Direction
    Returns the pitch.
    final org.djunits.value.vdouble.scalar.Direction
    Returns the roll.
    final org.djunits.value.vdouble.scalar.Direction
    Returns the yaw.
    final String
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Direction3d

      public Direction3d(org.djunits.value.vdouble.vector.DirectionVector rotation) throws ValueRuntimeException
      Constructor.
      Parameters:
      rotation - the angles in 3D (RPY coded)
      Throws:
      ValueRuntimeException - in case the vector does not have exactly three elements
    • Direction3d

      public Direction3d(org.djunits.value.vdouble.scalar.Direction roll, org.djunits.value.vdouble.scalar.Direction pitch, org.djunits.value.vdouble.scalar.Direction yaw) throws ValueRuntimeException
      Constructor.
      Parameters:
      roll - (phi) the rotation around the x-axis
      pitch - (theta) the rotation around the y-axis
      yaw - (psi) the rotation around the z-axis
      Throws:
      ValueRuntimeException - in case the units are incorrect
    • Direction3d

      public Direction3d(double roll, double pitch, double yaw, DirectionUnit unit) throws ValueRuntimeException
      Constructor.
      Parameters:
      roll - (phi) the rotation around the x-axis
      pitch - (theta) the rotation around the y-axis
      yaw - (psi) the rotation around the z-axis
      unit - the unit of the RPY parameters
      Throws:
      ValueRuntimeException - in case the units are incorrect
  • Method Details

    • getRoll

      public final org.djunits.value.vdouble.scalar.Direction getRoll()
      Returns the roll.
      Returns:
      the roll.
    • getPitch

      public final org.djunits.value.vdouble.scalar.Direction getPitch()
      Returns the pitch.
      Returns:
      the pitch.
    • getYaw

      public final org.djunits.value.vdouble.scalar.Direction getYaw()
      Returns the yaw.
      Returns:
      the yaw.
    • toString

      public final String toString()
      Overrides:
      toString in class Object