FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
rotation_angle_utils.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2//
3// Copyright (c) 2026-present FERS Contributors (see AUTHORS.md).
4//
5// See the GNU GPLv2 LICENSE file in the FERS project root for more information.
6
7#pragma once
8
9#include "core/config.h"
10#include "core/parameters.h"
11#include "math/coord.h"
12
14{
15 inline RealType unit_to_radians(const RealType value, const params::RotationAngleUnit unit) noexcept
16 {
17 return unit == params::RotationAngleUnit::Degrees ? value * (PI / 180.0) : value;
18 }
19
20 inline RealType radians_to_unit(const RealType value, const params::RotationAngleUnit unit) noexcept
21 {
22 return unit == params::RotationAngleUnit::Degrees ? value * 180.0 / PI : value;
23 }
24
26 const RealType time,
27 const params::RotationAngleUnit unit) noexcept
28 {
29 return {(PI / 2.0) - unit_to_radians(azimuth, unit), unit_to_radians(elevation, unit), time};
30 }
31
33 const RealType elevation_rate, const RealType time,
34 const params::RotationAngleUnit unit) noexcept
35 {
36 return {-unit_to_radians(azimuth_rate, unit), unit_to_radians(elevation_rate, unit), time};
37 }
38
40 {
41 return radians_to_unit((PI / 2.0) - azimuth, unit);
42 }
43
45 const params::RotationAngleUnit unit) noexcept
46 {
47 return radians_to_unit(elevation, unit);
48 }
49
51 const params::RotationAngleUnit unit) noexcept
52 {
53 return radians_to_unit(-azimuth_rate, unit);
54 }
55
57 const params::RotationAngleUnit unit) noexcept
58 {
59 return radians_to_unit(elevation_rate, unit);
60 }
61}
Global configuration file for the project.
double RealType
Type for real numbers.
Definition config.h:27
constexpr RealType PI
Mathematical constant π (pi).
Definition config.h:43
Coordinate and rotation structure operations.
RotationAngleUnit
Defines the units used at external rotation-path boundaries.
Definition parameters.h:41
@ Degrees
Compass azimuth and elevation expressed in degrees.
RealType internal_elevation_to_external(const RealType elevation, const params::RotationAngleUnit unit) noexcept
RealType internal_azimuth_rate_to_external(const RealType azimuth_rate, const params::RotationAngleUnit unit) noexcept
math::RotationCoord external_rotation_to_internal(const RealType azimuth, const RealType elevation, const RealType time, const params::RotationAngleUnit unit) noexcept
RealType internal_elevation_rate_to_external(const RealType elevation_rate, const params::RotationAngleUnit unit) noexcept
RealType internal_azimuth_to_external(const RealType azimuth, const params::RotationAngleUnit unit) noexcept
RealType unit_to_radians(const RealType value, const params::RotationAngleUnit unit) noexcept
RealType radians_to_unit(const RealType value, const params::RotationAngleUnit unit) noexcept
math::RotationCoord external_rotation_rate_to_internal(const RealType azimuth_rate, const RealType elevation_rate, const RealType time, const params::RotationAngleUnit unit) noexcept
Defines the Parameters struct and provides methods for managing simulation parameters.
Represents a rotation in terms of azimuth, elevation, and time.
Definition coord.h:72