Skip to content

Class VelocityVector

ClassList > VelocityVector

Represents a 3D velocity vector. More...

  • #include <spatial.h>

Inherits the following classes: FixedVector3D

Public Types

Type Name
typedef FixedVector3D< VelocityVector > Vec

Public Types inherited from FixedVector3D

See FixedVector3D

Type Name
typedef Vector3D< fixed, Derived > Vec

Public Types inherited from Vector3D

See Vector3D

Type Name
typedef Either< Derived, Vector3D< NumericType > > ClassType
typedef Numeric NumericType

Public Attributes inherited from Vector3D

See Vector3D

Type Name
NumericType X_coord = 0
The X-coordinate of the vector.
NumericType Y_coord = 0
The Y-coordinate of the vector.
NumericType Z_coord = 0
The Z-coordinate of the vector.

Public Static Attributes inherited from Vector3D

See Vector3D

Type Name
constexpr Vector3D< Numeric > Backward = [**Vector3D**](classVector3D.md)&lt;Numeric&gt;(0, -1, 0)
constexpr Vector3D< Numeric > Down = [**Vector3D**](classVector3D.md)&lt;Numeric&gt;(0, 0, -1)
constexpr Vector3D< Numeric > Forward = [**Vector3D**](classVector3D.md)&lt;Numeric&gt;(0, 1, 0)
constexpr Vector3D< Numeric > Left = [**Vector3D**](classVector3D.md)&lt;Numeric&gt;(-1, 0, 0)
constexpr Vector3D< Numeric > Right = [**Vector3D**](classVector3D.md)&lt;Numeric&gt;(1, 0, 0)
constexpr Vector3D< Numeric > Up = [**Vector3D**](classVector3D.md)&lt;Numeric&gt;(0, 0, 1)
constexpr NumericType rad2DegFactor = NumericType(57.2957795131)

Public Functions

Type Name
VelocityVector () = default
VelocityVector (const VelocityVector & other) = default
constexpr VelocityVector (fixed x, fixed y, fixed z)
VelocityVector (DistanceVector dist, TimeInterval interval)
Constructs a VelocityVector from aDistanceVector and a time interval.

Public Functions inherited from FixedVector3D

See FixedVector3D

Type Name
fixed angleTo (const VectorCompatible< fixed > auto & other) const
Derived cross (const VectorCompatible< fixed > auto & other) const
fixed dot (const VectorCompatible< fixed > auto & other) const
fixed magnitude () const
fixed magnitudeXY () const
fixed magnitudeXZ () const
fixed magnitudeYZ () const
Derived normalize () const
NumericType pitch () const
NumericType yaw () const

Public Functions inherited from Vector3D

See Vector3D

Type Name
constexpr ClassType FromPolarDegrees (NumericType Pitch, NumericType Yaw, NumericType Radius)
constexpr Vector3D ()
constexpr Vector3D (NumericType initial_X_coord, NumericType initial_Y_coord, NumericType initial_Z_coord)
NumericType angleTo (const VectorCompatible< NumericType > auto & other) const
Computes the angle to another vector.
ClassType cross (const VectorCompatible< NumericType > auto & other) const
Computes the cross product of two vectors.
NumericType dot (const VectorCompatible< NumericType > auto & other) const
Computes the dot product of two vectors.
NumericType magnitude () const
Computes the magnitude (length) of the vector.
NumericType magnitudeXY () const
Computes the magnitude in the XY plane.
NumericType magnitudeXZ () const
Computes the magnitude in the XZ plane.
NumericType magnitudeYZ () const
Computes the magnitude in the YZ plane.
ClassType normalize () const
Computes the normalized vector (unit vector).
operator bool () const
Checks if the vector is non-zero.
constexpr ClassType operator* (const NumericType & scalar) const
Multiplies the vector by a scalar.
ClassType operator+ (const VectorCompatible< NumericType > auto & other) const
Adds two vectors.
ClassType operator- (const VectorCompatible< NumericType > auto & other) const
Subtracts one vector from another.
ClassType operator/ (NumericType scalar) const
Divides the vector by a scalar.
NumericType pitch () const
Computes the pitch angle of the vector.
NumericType yaw () const
Computes the yaw angle of the vector.

Public Static Functions inherited from FixedVector3D

See FixedVector3D

Type Name
fixed integer_sqrt (uint64_t n)

Detailed Description

This class is used to define the rate of change of position.

Public Types Documentation

typedef Vec

using VelocityVector::Vec =  FixedVector3D<VelocityVector>;

Public Functions Documentation

function VelocityVector [1/4]

VelocityVector::VelocityVector () = default

function VelocityVector [2/4]

VelocityVector::VelocityVector (
    const VelocityVector & other
) = default

function VelocityVector [3/4]

constexpr VelocityVector::VelocityVector (
    fixed x,
    fixed y,
    fixed z
) 

function VelocityVector [4/4]

Constructs a VelocityVector from aDistanceVector and a time interval.

inline VelocityVector::VelocityVector (
    DistanceVector dist,
    TimeInterval interval
) 

Parameters:

  • dist The distance vector.
  • interval The time interval.


The documentation for this class was generated from the following file spatial.h