MCPcopy Create free account
hub / github.com/OSGeo/PROJ / cartesian

Function cartesian

src/conversions/cart.cpp:139–153  ·  view source on GitHub ↗

/

Source from the content-addressed store, hash-verified

137
138/*********************************************************************/
139static PJ_XYZ cartesian(PJ_LPZ geod, PJ *P) {
140 /*********************************************************************/
141 PJ_XYZ xyz;
142
143 const double cosphi = cos(geod.phi);
144 const double sinphi = sin(geod.phi);
145 const double N = normal_radius_of_curvature(P->a, P->es, sinphi);
146
147 /* HM formula 5-27 (z formula follows WP) */
148 xyz.x = (N + geod.z) * cosphi * cos(geod.lam);
149 xyz.y = (N + geod.z) * cosphi * sin(geod.lam);
150 xyz.z = (N * (1 - P->es) + geod.z) * sinphi;
151
152 return xyz;
153}
154
155/*********************************************************************/
156static PJ_LPZ geodetic(PJ_XYZ cart, PJ *P) {

Callers 1

cart_forwardFunction · 0.85

Calls 1

Tested by

no test coverage detected