# healpy.pixelfunc.ang2vec¶

healpy.pixelfunc.ang2vec(theta, phi, lonlat=False)

ang2vec : convert angles to 3D position vector

Parameters
thetafloat, scalar or arry-like

colatitude in radians measured southward from north pole (in [0,pi]).

phifloat, scalar or array-like

longitude in radians measured eastward (in [0, 2*pi]).

lonlatbool

If True, input angles are assumed to be longitude and latitude in degree, otherwise, they are co-latitude and longitude in radians.

Returns
vecfloat, array

if theta and phi are vectors, the result is a 2D array with a vector per row otherwise, it is a 1D array of shape (3,)

vec2ang, rotator.dir2vec, rotator.vec2dir