radec_to_vector

spherical_geometry.vector.radec_to_vector(lon, lat, degrees=True)

Converts a location on the unit sphere from longitude and latitude to an x, y, z vector.

Parameters:
lon, latscalars or 1-D arrays
degreesbool, optional

If True, (default) lon and lat are in decimal degrees, otherwise in radians.

Returns:
x, y, ztuple of scalars or 1-D arrays of the same length

Notes

Where longitude is l and latitude is b:

\[ \begin{align}\begin{aligned}x = \cos l \cos b\\y = \sin l \cos b\\z = \sin b\end{aligned}\end{align} \]