Package org.opentrafficsim.core.math
Class Direction3D
- java.lang.Object
-
- org.opentrafficsim.core.math.Direction3D
-
- All Implemented Interfaces:
Serializable
public class Direction3D extends Object implements Serializable
3D-rotation, RPY coded (longitudinal roll around the x-axis, lateral pitch around the y-axis and vertical yaw around 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-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Dec 10, 2015
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Direction3D(double roll, double pitch, double yaw, DirectionUnit unit)Construct a new Direction3D.Direction3D(Direction roll, Direction pitch, Direction yaw)Construct a new Direction3D.Direction3D(DirectionVector rotation)Construct a new Direction3D.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectiongetPitch()Retrieve the pitch (rotation around the x-axis).DirectiongetRoll()Retrieve the roll (rotation around the x-axis).DirectiongetYaw()Retrieve the yaw (rotation around the x-axis).StringtoString()
-
-
-
Constructor Detail
-
Direction3D
public Direction3D(DirectionVector rotation) throws ValueRuntimeException
Construct a new Direction3D.- Parameters:
rotation- DirectionVector; the angles in 3D (RPY coded)- Throws:
ValueRuntimeException- in case the vector does not have exactly three elements
-
Direction3D
public Direction3D(Direction roll, Direction pitch, Direction yaw) throws ValueRuntimeException
Construct a new Direction3D.- 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:
ValueRuntimeException- in case the units are incorrect
-
Direction3D
public Direction3D(double roll, double pitch, double yaw, DirectionUnit unit) throws ValueRuntimeExceptionConstruct a new Direction3D.- 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:
ValueRuntimeException- in case the units are incorrect
-
-
Method Detail
-
getRoll
public final Direction getRoll()
Retrieve the roll (rotation around the x-axis).- Returns:
- Direction; the roll.
-
getPitch
public final Direction getPitch()
Retrieve the pitch (rotation around the x-axis).- Returns:
- Direction; the pitch.
-
getYaw
public final Direction getYaw()
Retrieve the yaw (rotation around the x-axis).- Returns:
- Direction; the yaw
-
-