56 const auto referencePointLLA =
ECEFtoLLA(referencePoint);
58 const auto sinLat =
std::sin(referencePointLLA.latitude);
59 const auto cosLat =
std::cos(referencePointLLA.latitude);
60 const auto sinLon =
std::sin(referencePointLLA.longitude);
61 const auto cosLon =
std::cos(referencePointLLA.longitude);
64 rotationMatrix(0, 0) = -sinLat * cosLon;
65 rotationMatrix(1, 0) = -sinLat * sinLon;
66 rotationMatrix(2, 0) = cosLat;
67 rotationMatrix(0, 1) = -sinLon;
68 rotationMatrix(1, 1) = cosLon;
69 rotationMatrix(2, 1) = 0.;
70 rotationMatrix(0, 2) = -cosLat * cosLon;
71 rotationMatrix(1, 2) = -cosLat * sinLon;
72 rotationMatrix(2, 2) = -sinLat;
75 targetVec[0] = target.north();
76 targetVec[1] = target.east();
77 targetVec[2] = target.down();
80 referencePointVec[0] = referencePoint.x;
81 referencePointVec[1] = referencePoint.y;
82 referencePointVec[2] = referencePoint.z;
84 const auto targetECEFVec =
dot(rotationMatrix, targetVec) + referencePointVec;
85 return { targetECEFVec[0], targetECEFVec[1], targetECEFVec[2] };
ECEF coordinates.
Definition: ECEF.hpp:40
Geodetic coordinates.
Definition: LLA.hpp:40
North east down coordinates.
Definition: NED.hpp:40
auto sin(dtype inValue) noexcept
Definition: sin.hpp:49
NdArray< dtype > dot(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition: dot.hpp:47
auto cos(dtype inValue) noexcept
Definition: cos.hpp:49