55 const auto referencePointLLA =
ECEFtoLLA(referencePoint);
57 const auto sinLat = std::sin(referencePointLLA.latitude);
58 const auto cosLat = std::cos(referencePointLLA.latitude);
59 const auto sinLon = std::sin(referencePointLLA.longitude);
60 const auto cosLon = std::cos(referencePointLLA.longitude);
63 rotationMatrix(0, 0) = -sinLat * cosLon;
64 rotationMatrix(1, 0) = -sinLat * sinLon;
65 rotationMatrix(2, 0) = cosLat;
66 rotationMatrix(0, 1) = -sinLon;
67 rotationMatrix(1, 1) = cosLon;
68 rotationMatrix(2, 1) = 0.;
69 rotationMatrix(0, 2) = -cosLat * cosLon;
70 rotationMatrix(1, 2) = -cosLat * sinLon;
71 rotationMatrix(2, 2) = -sinLat;
74 targetVec[0] = target.north();
75 targetVec[1] = target.east();
76 targetVec[2] = target.down();
79 referencePointVec[0] = referencePoint.x;
80 referencePointVec[1] = referencePoint.y;
81 referencePointVec[2] = referencePoint.z;
83 const auto targetECEFVec =
dot(rotationMatrix, targetVec) + referencePointVec;
84 return { targetECEFVec[0], targetECEFVec[1], targetECEFVec[2] };