NumCpp
2.16.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
Loading...
Searching...
No Matches
ECEFtoENU.hpp
Go to the documentation of this file.
1
28
#pragma once
29
30
#include <cmath>
31
32
#include "
NumCpp/Coordinates/ReferenceFrames/ECEF.hpp
"
33
#include "
NumCpp/Coordinates/ReferenceFrames/ENU.hpp
"
34
#include "
NumCpp/Coordinates/ReferenceFrames/LLA.hpp
"
35
#include "
NumCpp/Coordinates/Transforms/ECEFtoLLA.hpp
"
36
#include "
NumCpp/Coordinates/Transforms/LLAtoECEF.hpp
"
37
38
namespace
nc::coordinates::transforms
39
{
49
[[
nodiscard
]]
inline
reference_frames::ENU
ECEFtoENU
(
const
reference_frames::ECEF
&
target
,
50
const
reference_frames::LLA
&
referencePoint
)
noexcept
51
{
52
const
auto
sinLat
= std::sin(
referencePoint
.latitude);
53
const
auto
cosLat
= std::cos(
referencePoint
.latitude);
54
const
auto
sinLon
= std::sin(
referencePoint
.longitude);
55
const
auto
cosLon
= std::cos(
referencePoint
.longitude);
56
57
const
auto
referencePointECEF
=
LLAtoECEF
(
referencePoint
);
58
59
const
auto
x =
target
.x -
referencePointECEF
.x;
60
const
auto
y =
target
.y -
referencePointECEF
.y;
61
const
auto
z =
target
.z -
referencePointECEF
.z;
62
63
return
{ -
sinLon
* x +
cosLon
* y,
64
-
sinLat
*
cosLon
* x -
sinLat
*
sinLon
* y +
cosLat
* z,
65
cosLat
*
cosLon
* x +
cosLat
*
sinLon
* y +
sinLat
* z };
66
}
67
77
[[
nodiscard
]]
inline
reference_frames::ENU
ECEFtoENU
(
const
reference_frames::ECEF
&
target
,
78
const
reference_frames::ECEF
&
referencePoint
)
noexcept
79
{
80
return
ECEFtoENU
(
target
,
ECEFtoLLA
(
referencePoint
));
81
}
82
}
// namespace nc::coordinates::transforms
ECEF.hpp
ECEFtoLLA.hpp
ENU.hpp
LLA.hpp
LLAtoECEF.hpp
nc::coordinates::reference_frames::ECEF
ECEF coordinates.
Definition
ECEF.hpp:40
nc::coordinates::reference_frames::ENU
East North Up coordinates.
Definition
ENU.hpp:40
nc::coordinates::reference_frames::LLA
Geodetic coordinates.
Definition
LLA.hpp:40
nc::coordinates::transforms
Definition
AERtoECEF.hpp:38
nc::coordinates::transforms::LLAtoECEF
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
nc::coordinates::transforms::ECEFtoENU
reference_frames::ENU ECEFtoENU(const reference_frames::ECEF &target, const reference_frames::LLA &referencePoint) noexcept
Converts the ECEF coordinates to ENU https://apps.dtic.mil/sti/pdfs/AD1170763.pdf Figure 11 https://a...
Definition
ECEFtoENU.hpp:49
nc::coordinates::transforms::ECEFtoLLA
reference_frames::LLA ECEFtoLLA(const reference_frames::ECEF &ecef, double tol=1e-8) noexcept
Converts ECEF coordinates to LLA https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_...
Definition
ECEFtoLLA.hpp:49
nc::arange
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition
arange.hpp:59
include
NumCpp
Coordinates
Transforms
ECEFtoENU.hpp
Generated by
1.9.8