NDEVR
API Documentation
AngleDefinitions

Logic for converting between Euler angles and basic rotations or normals. More...

Static Public Member Functions

template<class t_angle_type, uint01 t_dims, class t_type>
static constexpr Angle< t_angle_type > AngleBetween (const Vector< t_dims, t_type > &a, const Vector< t_dims, t_type > &b)
 Computes the angle between two vectors.
static const fltp08CalcIndexSin ()
template<class t_angle_type, uint01 t_dims, class t_type>
static constexpr Angle< t_angle_type > Heading (const Vector< t_dims, t_type > ray)
 Computes the heading angle from a direction vector.
template<class t_angle_type>
static Angle< t_angle_type > Inclination (const Angle< t_angle_type > &roll, const Angle< t_angle_type > &pitch)
template<class t_angle_type, uint01 t_dims, class t_type>
static constexpr Angle< t_angle_type > Inclination (const Vector< t_dims, t_type > ray)
 Computes the inclination angle from a direction vector.
template<class t_angle_type>
static Vector< 3, Angle< t_angle_type > > NormalizeOrientation (Vector< 3, Angle< t_angle_type > > angle, const Vector< 3, Angle< t_angle_type > > &reference)
 Normalizes an orientation to be consistent with a reference orientation, avoiding discontinuities.
template<class t_angle_type, class t_type>
static Vector< 3, Angle< t_angle_type > > NormalToOrientation (const Vector< 3, t_type > &normal, const Angle< t_angle_type > &yaw=Angle< t_angle_type >(0))
 Normal to orientation.
template<bool t_normalized, uint01 t_dims, class t_angle_type>
static constexpr Vector< t_dims, fltp08Orientation (AngleType angle_type, const Vector< t_dims, Angle< t_angle_type > > &ray)
 Converts a Vector of Angles to a Vector of scalar values in the specified angle type.
template<class t_angle_type, uint01 t_dims, class t_type>
static constexpr Vector< t_dims, Angle< t_angle_type > > Orientation (AngleType angle_type, const Vector< t_dims, t_type > &ray)
 Constructs a Vector of Angles from a Vector of scalar values and a specified angle type.
static Vector< 4, fltp08OrientationToQuaternion (const Vector< 3, Angle< fltp08 > > &quaternion)
 Converts Euler angles (Roll, Pitch and Yaw) to a quaternion.
static Vector< 3, Angle< fltp08 > > QuaternionToOrientation (const Vector< 4, fltp08 > &quaternion)
 Converts a quaternion to Euler angles (Roll, Pitch and Yaw).
template<class t_angle_type, uint01 t_dims, class t_type>
static Angle< t_angle_type > Rotation (const Vector< t_dims, t_type > &left, const Vector< t_dims, t_type > &middle, const Vector< t_dims, t_type > &right)
 Gets a rotation.

Detailed Description

Logic for converting between Euler angles and basic rotations or normals.

Definition at line 777 of file AngleFunctions.h.

Member Function Documentation

◆ AngleBetween()

template<class t_angle_type, uint01 t_dims, class t_type>
constexpr Angle< t_angle_type > AngleDefinitions::AngleBetween ( const Vector< t_dims, t_type > & a,
const Vector< t_dims, t_type > & b )
inlinestaticconstexpr

Computes the angle between two vectors.

Parameters
[in]aThe first vector.
[in]bThe second vector.
Returns
The angle between the two vectors.

Definition at line 863 of file AngleFunctions.h.

References Angle< t_type >::acos(), cast(), clip(), and dot().

◆ CalcIndexSin()

const fltp08 * AngleDefinitions::CalcIndexSin ( )
static
    Calculates the index sine.

Author: Tyler Parke

Date: 2017-11-13

Returns
Null if it fails, else the calculated index sine.

◆ Heading()

template<class t_angle_type, uint01 t_dims, class t_type>
constexpr Angle< t_angle_type > AngleDefinitions::Heading ( const Vector< t_dims, t_type > ray)
inlinestaticconstexpr

Computes the heading angle from a direction vector.

Parameters
[in]rayThe direction vector to compute heading from.
Returns
The heading angle (azimuth in the XY plane).

Definition at line 852 of file AngleFunctions.h.

References Angle< t_type >::atan2().

◆ Inclination() [1/2]

template<class t_angle_type>
Angle< t_angle_type > AngleDefinitions::Inclination ( const Angle< t_angle_type > & roll,
const Angle< t_angle_type > & pitch )
inlinestatic
    Gets the Inclination of .

Author: Tyler Parke

Date: 2018-08-15

Parameters: roll - The rotation about the X axis. pitch - The rotation about the Y axis.

Returns
The rotation.

Definition at line 829 of file AngleFunctions.h.

References Angle< t_type >::atan(), cast(), sqrt(), and tan().

◆ Inclination() [2/2]

template<class t_angle_type, uint01 t_dims, class t_type>
constexpr Angle< t_angle_type > AngleDefinitions::Inclination ( const Vector< t_dims, t_type > ray)
inlinestaticconstexpr

Computes the inclination angle from a direction vector.

Parameters
[in]rayThe direction vector to compute inclination from.
Returns
The inclination angle (elevation from the XY plane).

Definition at line 840 of file AngleFunctions.h.

References Angle< t_type >::atan2().

◆ NormalizeOrientation()

template<class t_angle_type>
Vector< 3, Angle< t_angle_type > > AngleDefinitions::NormalizeOrientation ( Vector< 3, Angle< t_angle_type > > angle,
const Vector< 3, Angle< t_angle_type > > & reference )
inlinestatic

Normalizes an orientation to be consistent with a reference orientation, avoiding discontinuities.

Parameters
[in]angleThe orientation to normalize.
[in]referenceThe reference orientation to normalize against.
Returns
The normalized orientation adjusted to be continuous with the reference.

Definition at line 936 of file AngleFunctions.h.

References DEGREES, PITCH, ROLL, and YAW.

◆ NormalToOrientation()

template<class t_angle_type, class t_type>
Vector< 3, Angle< t_angle_type > > AngleDefinitions::NormalToOrientation ( const Vector< 3, t_type > & normal,
const Angle< t_angle_type > & yaw = Angle<t_angle_type>(0) )
inlinestatic

Normal to orientation.

Author: Tyler Parke

Date: 2017-11-13

Parameters: normal - The normal. yaw - (Optional) The yaw.

Returns
A Vector<3,Angle>

Definition at line 914 of file AngleFunctions.h.

References cast(), cos(), DEGREES, RADIANS, and sin().

◆ Orientation() [1/2]

template<bool t_normalized, uint01 t_dims, class t_angle_type>
constexpr Vector< t_dims, fltp08 > AngleDefinitions::Orientation ( AngleType angle_type,
const Vector< t_dims, Angle< t_angle_type > > & ray )
inlinestaticconstexpr

Converts a Vector of Angles to a Vector of scalar values in the specified angle type.

Parameters
[in]angle_typeThe target angle unit for the output scalar values (e.g., DEGREES, RADIANS).
[in]rayThe Vector of Angles to convert.
Returns
A Vector of scalar fltp08 values representing the angles in the specified unit.

Definition at line 892 of file AngleFunctions.h.

◆ Orientation() [2/2]

template<class t_angle_type, uint01 t_dims, class t_type>
constexpr Vector< t_dims, Angle< t_angle_type > > AngleDefinitions::Orientation ( AngleType angle_type,
const Vector< t_dims, t_type > & ray )
inlinestaticconstexpr

Constructs a Vector of Angles from a Vector of scalar values and a specified angle type.

Parameters
[in]angle_typeThe unit of the input scalar values (e.g., DEGREES, RADIANS).
[in]rayThe Vector of scalar values to convert to Angles.
Returns
A Vector of Angles constructed from the input values.

Definition at line 878 of file AngleFunctions.h.

Referenced by quantize(), and quantize().

◆ OrientationToQuaternion()

Vector< 4, fltp08 > AngleDefinitions::OrientationToQuaternion ( const Vector< 3, Angle< fltp08 > > & quaternion)
static

Converts Euler angles (Roll, Pitch and Yaw) to a quaternion.

Parameters
[in]quaternionThe Euler angles to convert.
Returns
The quaternion representation of the given Euler angles.

◆ QuaternionToOrientation()

Vector< 3, Angle< fltp08 > > AngleDefinitions::QuaternionToOrientation ( const Vector< 4, fltp08 > & quaternion)
static

Converts a quaternion to Euler angles (Roll, Pitch and Yaw).

Parameters
[in]quaternionThe quaternion to compute
Returns
The Euler angles of that quaternion.

◆ Rotation()

template<class t_angle_type, uint01 t_dims, class t_type>
Angle< t_angle_type > AngleDefinitions::Rotation ( const Vector< t_dims, t_type > & left,
const Vector< t_dims, t_type > & middle,
const Vector< t_dims, t_type > & right )
inlinestatic

Gets a rotation.

Author: Tyler Parke

Date: 2017-11-13

Parameters: left - The left. middle - The middle. right - The right.

Returns
The rotation.

Definition at line 809 of file AngleFunctions.h.

References cast(), dot(), Vector< t_dims, t_type >::magnitudeSquared(), RADIANS, and sqrt().

Referenced by Triangle< t_dims, t_type, t_vertex >::angle().


The documentation for this class was generated from the following file: