pymgp.crstrans.plh2xyz#
- pymgp.crstrans.plh2xyz(plh, ellipsoid='current', unit='rad')[source]#
Convert ellipsoidal coordinates (latitude, longitude and height) to Cartesian coordinates.
- Parameters:
- plharray_like shape (…,3)
Ellipsoidal coordinates (geographic latitude, longitude and height above the ellipsoid).
- ellipsoidstr or list of floats, default = ‘current’
Text string with the name of the ellipse or a list
[a, 1/f]
with the semi-major axis a and inverse flattening 1/f. The current ellipsoid can be set by setell. Default for the current ellips is ‘WGS-84’.- unit{‘rad’, ‘deg’}, default = ‘rad’
Units for the input latitude and longitude.
- Returns:
- xyzndarray with the same shape (…,3) as plh
Cartesian XYZ coordinates.
Examples
>>> xyz = plh2xyz([52, 4, 0], unit='deg') >>> print(np.round(xyz,4)) [3925375.1007 274488.9665 5002803.3455]
>>> plhin = [ [50, 0, 0], [51, 1, -4], [52, 4, 2], [53, 3, 3] ] >>> xyz = plh2xyz(plhin, unit='deg') >>> plh = xyz2plh(xyz, unit='deg') >>> print( np.max(np.abs(plh-plhin)) < 1e-9) True