NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
LLAtoECEF.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <cmath>
31
35#include "NumCpp/Utils/sqr.hpp"
36
38{
46 [[nodiscard]] inline reference_frames::ECEF LLAtoECEF(const reference_frames::LLA& point) noexcept
47 {
50 constexpr auto E_SQR = 1. - B2_DIV_A2;
51
52 const auto sinLat = std::sin(point.latitude);
53 const auto cosLat = std::cos(point.latitude);
54 const auto sinLon = std::sin(point.longitude);
55 const auto cosLon = std::cos(point.longitude);
56
57 const auto primeVerticalMeridian =
59
60 return reference_frames::ECEF{ (primeVerticalMeridian + point.altitude) * cosLat * cosLon,
61 (primeVerticalMeridian + point.altitude) * cosLat * sinLon,
62 (B2_DIV_A2 * primeVerticalMeridian + point.altitude) * sinLat };
63 }
64} // namespace nc::coordinates::transforms
ECEF coordinates.
Definition: ECEF.hpp:40
Geodetic coordinates.
Definition: LLA.hpp:40
constexpr double EARTH_POLAR_RADIUS
Definition: Coordinates/ReferenceFrames/Constants.hpp:33
constexpr double EARTH_EQUATORIAL_RADIUS
Definition: Coordinates/ReferenceFrames/Constants.hpp:34
Definition: AERtoECEF.hpp:38
reference_frames::ECEF LLAtoECEF(const reference_frames::LLA &point) noexcept
Converts the LLA coordinates to ECEF https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#F...
Definition: LLAtoECEF.hpp:46
constexpr dtype sqr(dtype inValue) noexcept
Definition: sqr.hpp:42
auto sin(dtype inValue) noexcept
Definition: sin.hpp:49
auto cos(dtype inValue) noexcept
Definition: cos.hpp:49
auto sqrt(dtype inValue) noexcept
Definition: sqrt.hpp:48