Class Acceleration3d

java.lang.Object
org.opentrafficsim.core.math.Acceleration3d
All Implemented Interfaces:
Serializable

public class Acceleration3d extends Object implements Serializable
A 3D acceleration vector, decomposed in X, Y, and Z-acceleration with easy conversion from and to a spherical coordinate system.
Physicists and mathematicians do not agree on the meaning of theta and phi. In this class the convention in the physics domain is used:
  • theta is the angle from the z direction.
  • phi is the projected angle in the xy-plane from the x direction.
N.B. In the geography domain yet another convention is used.

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

    Constructors
    Constructor
    Description
    Acceleration3d(double x, double y, double z, org.djunits.unit.AccelerationUnit unit)
    Construct a new Acceleration3d from three double Cartesian coordinates and a acceleration unit.
    Acceleration3d(org.djunits.value.vdouble.scalar.Acceleration x, org.djunits.value.vdouble.scalar.Acceleration y, org.djunits.value.vdouble.scalar.Acceleration z)
    Construct a new Acceleration3d from three strongly typed Cartesian coordinates.
    Acceleration3d(org.djunits.value.vdouble.scalar.Acceleration acceleration, org.djunits.value.vdouble.scalar.Direction theta, org.djunits.value.vdouble.scalar.Direction phi)
    Construct a new Acceleration3d from a strongly typed acceleration and polar coordinates.
    Acceleration3d(org.djunits.value.vdouble.vector.AccelerationVector acceleration)
    Construct a new Acceleration3d from vector of strongly typed Cartesian coordinates.
  • Method Summary

    Modifier and Type
    Method
    Description
    final org.djunits.value.vdouble.scalar.Acceleration
    Retrieve the norm of this Acceleration3d.
    final org.djunits.value.vdouble.scalar.Direction
    Retrieve the phi of this Acceleration3d.
    final org.djunits.value.vdouble.scalar.Direction
    Retrieve the theta of this Acceleration3d.
    final org.djunits.value.vdouble.scalar.Acceleration
    Retrieve the x-component of this Acceleration3d.
    final org.djunits.value.vdouble.scalar.Acceleration
    Retrieve the y-component of this Acceleration3d.
    final org.djunits.value.vdouble.scalar.Acceleration
    Retrieve the z-component of this Acceleration3d.
    final String

    Methods inherited from class java.lang.Object

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

    • Acceleration3d

      public Acceleration3d(org.djunits.value.vdouble.vector.AccelerationVector acceleration) throws org.djunits.value.ValueRuntimeException
      Construct a new Acceleration3d from vector of strongly typed Cartesian coordinates.
      Parameters:
      acceleration - AccelerationVector; the accelerations in 3D (YPR coded)
      Throws:
      org.djunits.value.ValueRuntimeException - in case the vector does not have exactly three elements
    • Acceleration3d

      public Acceleration3d(org.djunits.value.vdouble.scalar.Acceleration x, org.djunits.value.vdouble.scalar.Acceleration y, org.djunits.value.vdouble.scalar.Acceleration z) throws org.djunits.value.ValueRuntimeException
      Construct a new Acceleration3d from three strongly typed Cartesian coordinates.
      Parameters:
      x - Acceleration; the acceleration in the x-direction
      y - Acceleration; the acceleration in the y-direction
      z - Acceleration; the acceleration in the z-direction
      Throws:
      org.djunits.value.ValueRuntimeException - in case the units are incorrect
    • Acceleration3d

      public Acceleration3d(double x, double y, double z, org.djunits.unit.AccelerationUnit unit) throws org.djunits.value.ValueRuntimeException
      Construct a new Acceleration3d from three double Cartesian coordinates and a acceleration unit.
      Parameters:
      x - double; the acceleration in the x-direction
      y - double; the acceleration in the y-direction
      z - double; the acceleration in the z-direction
      unit - AccelerationUnit; the unit of the xyz parameters
      Throws:
      org.djunits.value.ValueRuntimeException - in case the units are incorrect
    • Acceleration3d

      public Acceleration3d(org.djunits.value.vdouble.scalar.Acceleration acceleration, org.djunits.value.vdouble.scalar.Direction theta, org.djunits.value.vdouble.scalar.Direction phi) throws org.djunits.value.ValueRuntimeException
      Construct a new Acceleration3d from a strongly typed acceleration and polar coordinates.
      Parameters:
      acceleration - Acceleration; the acceleration in the direction of the angle along the vector
      theta - Direction; the angle from the z direction
      phi - Direction; the projected angle in the xy-plane from the x direction
      Throws:
      org.djunits.value.ValueRuntimeException - in case the vector does not have exactly three elements
  • Method Details

    • getX

      public final org.djunits.value.vdouble.scalar.Acceleration getX()
      Retrieve the x-component of this Acceleration3d.
      Returns:
      the acceleration in the x-direction.
    • getY

      public final org.djunits.value.vdouble.scalar.Acceleration getY()
      Retrieve the y-component of this Acceleration3d.
      Returns:
      the acceleration in the y-direction.
    • getZ

      public final org.djunits.value.vdouble.scalar.Acceleration getZ()
      Retrieve the z-component of this Acceleration3d.
      Returns:
      the acceleration in the z-direction.
    • getTheta

      public final org.djunits.value.vdouble.scalar.Direction getTheta()
      Retrieve the theta of this Acceleration3d.
      Returns:
      the angle of direction perpendicular to the xy-plane
    • getPhi

      public final org.djunits.value.vdouble.scalar.Direction getPhi()
      Retrieve the phi of this Acceleration3d.
      Returns:
      the projected angle of direction in the xy-plane
    • getAcceleration

      public final org.djunits.value.vdouble.scalar.Acceleration getAcceleration()
      Retrieve the norm of this Acceleration3d.
      Returns:
      the combined acceleration in the direction of the angle
    • toString

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