/
| 137 | |
| 138 | /*********************************************************************/ |
| 139 | static 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 | /*********************************************************************/ |
| 156 | static PJ_LPZ geodetic(PJ_XYZ cart, PJ *P) { |
no test coverage detected