NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
LLAtoGeocentric.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <cmath>
31
36#include "NumCpp/Utils/sqr.hpp"
37
39{
46 [[nodiscard]] inline reference_frames::Geocentric LLAtoGeocentric(const reference_frames::LLA& point) noexcept
47 {
48 constexpr auto flatteningFactor =
51 const auto geocentricLatitude = atan(utils::sqr(1. - flatteningFactor) * std::tan(point.latitude));
52 return reference_frames::Geocentric{ geocentricLatitude, point.longitude, geocentricRadius(point) };
53 }
54} // namespace nc::coordinates::transforms
Geocentric coordinates.
Definition: Geocentric.hpp:40
double longitude
Definition: Geocentric.hpp:43
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
double geocentricRadius(const reference_frames::LLA &point) noexcept
Returns the geocentric radius.
Definition: geocentricRadius.hpp:44
reference_frames::Geocentric LLAtoGeocentric(const reference_frames::LLA &point) noexcept
Converts from geodetic to geocentric.
Definition: LLAtoGeocentric.hpp:46
constexpr dtype sqr(dtype inValue) noexcept
Definition: sqr.hpp:42
auto tan(dtype inValue) noexcept
Definition: tan.hpp:49