FERS 0.1.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
serial::rotation_angle_utils Namespace Reference

Functions

RealType unit_to_radians (const RealType value, const params::RotationAngleUnit unit) noexcept
 Converts a value from the given external unit to radians.
 
RealType radians_to_unit (const RealType value, const params::RotationAngleUnit unit) noexcept
 Converts a radian value to the requested external unit.
 
math::RotationCoord external_rotation_to_internal (const RealType azimuth, const RealType elevation, const RealType time, const params::RotationAngleUnit unit) noexcept
 Converts external compass azimuth/elevation into internal rotation coordinates.
 
math::RotationCoord external_rotation_rate_to_internal (const RealType azimuth_rate, const RealType elevation_rate, const RealType time, const params::RotationAngleUnit unit) noexcept
 Converts external compass azimuth/elevation rates into internal rotation rates.
 
RealType internal_azimuth_to_external (const RealType azimuth, const params::RotationAngleUnit unit) noexcept
 Converts an internal azimuth angle to the external compass convention.
 
RealType internal_elevation_to_external (const RealType elevation, const params::RotationAngleUnit unit) noexcept
 Converts an internal elevation angle to the external unit.
 
RealType internal_azimuth_rate_to_external (const RealType azimuth_rate, const params::RotationAngleUnit unit) noexcept
 Converts an internal azimuth rate to the external compass convention.
 
RealType internal_elevation_rate_to_external (const RealType elevation_rate, const params::RotationAngleUnit unit) noexcept
 Converts an internal elevation rate to the external unit.
 

Function Documentation

◆ external_rotation_rate_to_internal()

math::RotationCoord serial::rotation_angle_utils::external_rotation_rate_to_internal ( const RealType  azimuth_rate,
const RealType  elevation_rate,
const RealType  time,
const params::RotationAngleUnit  unit 
)
noexcept

Converts external compass azimuth/elevation rates into internal rotation rates.

Definition at line 36 of file rotation_angle_utils.h.

39 {
40 return {-unit_to_radians(azimuth_rate, unit), unit_to_radians(elevation_rate, unit), time};
41 }
RealType unit_to_radians(const RealType value, const params::RotationAngleUnit unit) noexcept
Converts a value from the given external unit to radians.
math::Vec3 max

References max, and unit_to_radians().

Referenced by serial::xml_parser_utils::parseFixedRotation(), and serial::update_platform_paths_from_json().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ external_rotation_to_internal()

math::RotationCoord serial::rotation_angle_utils::external_rotation_to_internal ( const RealType  azimuth,
const RealType  elevation,
const RealType  time,
const params::RotationAngleUnit  unit 
)
noexcept

Converts external compass azimuth/elevation into internal rotation coordinates.

Definition at line 28 of file rotation_angle_utils.h.

31 {
32 return {(PI / 2.0) - unit_to_radians(azimuth, unit), unit_to_radians(elevation, unit), time};
33 }
constexpr RealType PI
Mathematical constant π (pi).
Definition config.h:43

References PI, and unit_to_radians().

Referenced by fers_get_interpolated_rotation_path(), math::from_json(), serial::xml_parser_utils::parseFixedRotation(), serial::xml_parser_utils::parseRotationPath(), and serial::update_platform_paths_from_json().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ internal_azimuth_rate_to_external()

RealType serial::rotation_angle_utils::internal_azimuth_rate_to_external ( const RealType  azimuth_rate,
const params::RotationAngleUnit  unit 
)
noexcept

Converts an internal azimuth rate to the external compass convention.

Definition at line 57 of file rotation_angle_utils.h.

59 {
60 return radians_to_unit(-azimuth_rate, unit);
61 }
RealType radians_to_unit(const RealType value, const params::RotationAngleUnit unit) noexcept
Converts a radian value to the requested external unit.

References max, and radians_to_unit().

Referenced by serial::xml_serializer_utils::serializeRotation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ internal_azimuth_to_external()

RealType serial::rotation_angle_utils::internal_azimuth_to_external ( const RealType  azimuth,
const params::RotationAngleUnit  unit 
)
noexcept

Converts an internal azimuth angle to the external compass convention.

Definition at line 44 of file rotation_angle_utils.h.

45 {
46 return radians_to_unit((PI / 2.0) - azimuth, unit);
47 }

References PI, and radians_to_unit().

Referenced by fers_get_interpolated_rotation_path(), serial::kml_generator_utils::generateDirectionalAntennaKml(), serial::xml_serializer_utils::serializeRotation(), and math::to_json().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ internal_elevation_rate_to_external()

RealType serial::rotation_angle_utils::internal_elevation_rate_to_external ( const RealType  elevation_rate,
const params::RotationAngleUnit  unit 
)
noexcept

Converts an internal elevation rate to the external unit.

Definition at line 64 of file rotation_angle_utils.h.

66 {
67 return radians_to_unit(elevation_rate, unit);
68 }

References max, and radians_to_unit().

Referenced by serial::xml_serializer_utils::serializeRotation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ internal_elevation_to_external()

RealType serial::rotation_angle_utils::internal_elevation_to_external ( const RealType  elevation,
const params::RotationAngleUnit  unit 
)
noexcept

Converts an internal elevation angle to the external unit.

Definition at line 50 of file rotation_angle_utils.h.

52 {
53 return radians_to_unit(elevation, unit);
54 }

References radians_to_unit().

Referenced by fers_get_interpolated_rotation_path(), serial::kml_generator_utils::generateDirectionalAntennaKml(), serial::xml_serializer_utils::serializeRotation(), and math::to_json().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ radians_to_unit()

RealType serial::rotation_angle_utils::radians_to_unit ( const RealType  value,
const params::RotationAngleUnit  unit 
)
noexcept

Converts a radian value to the requested external unit.

Definition at line 22 of file rotation_angle_utils.h.

23 {
24 return unit == params::RotationAngleUnit::Degrees ? value * 180.0 / PI : value;
25 }
@ Degrees
Compass azimuth and elevation expressed in degrees.

References params::Degrees, and PI.

Referenced by internal_azimuth_rate_to_external(), internal_azimuth_to_external(), internal_elevation_rate_to_external(), and internal_elevation_to_external().

+ Here is the caller graph for this function:

◆ unit_to_radians()

RealType serial::rotation_angle_utils::unit_to_radians ( const RealType  value,
const params::RotationAngleUnit  unit 
)
noexcept

Converts a value from the given external unit to radians.

Definition at line 16 of file rotation_angle_utils.h.

17 {
18 return unit == params::RotationAngleUnit::Degrees ? value * (PI / 180.0) : value;
19 }

References params::Degrees, and PI.

Referenced by external_rotation_rate_to_internal(), and external_rotation_to_internal().

+ Here is the caller graph for this function: