Package org.opentrafficsim.core.math
Class Direction3d
java.lang.Object
org.opentrafficsim.core.math.Direction3d
- All Implemented Interfaces:
Serializable
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-2024 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
- See Also:
-
Constructor Summary
ConstructorDescriptionDirection3d
(double roll, double pitch, double yaw, org.djunits.unit.DirectionUnit unit) Direction3d
(org.djunits.value.vdouble.scalar.Direction roll, org.djunits.value.vdouble.scalar.Direction pitch, org.djunits.value.vdouble.scalar.Direction yaw) Direction3d
(org.djunits.value.vdouble.vector.DirectionVector rotation) -
Method Summary
-
Constructor Details
-
Direction3d
public Direction3d(org.djunits.value.vdouble.vector.DirectionVector rotation) throws org.djunits.value.ValueRuntimeException - Parameters:
rotation
- DirectionVector; the angles in 3D (RPY coded)- Throws:
org.djunits.value.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 org.djunits.value.ValueRuntimeException - Parameters:
roll
- Direction; (phi) the rotation around the x-axispitch
- Direction; (theta) the rotation around the y-axisyaw
- Direction; (psi) the rotation around the z-axis- Throws:
org.djunits.value.ValueRuntimeException
- in case the units are incorrect
-
Direction3d
public Direction3d(double roll, double pitch, double yaw, org.djunits.unit.DirectionUnit unit) throws org.djunits.value.ValueRuntimeException - Parameters:
roll
- double; (phi) the rotation around the x-axispitch
- double; (theta) the rotation around the y-axisyaw
- double; (psi) the rotation around the z-axisunit
- DirectionUnit; the unit of the RPY parameters- Throws:
org.djunits.value.ValueRuntimeException
- in case the units are incorrect
-
-
Method Details
-
getRoll
public final org.djunits.value.vdouble.scalar.Direction getRoll()- Returns:
- the roll.
-
getPitch
public final org.djunits.value.vdouble.scalar.Direction getPitch()- Returns:
- the pitch.
-
getYaw
public final org.djunits.value.vdouble.scalar.Direction getYaw()- Returns:
- the yaw.
-
toString
-