ang2vec

This IDL facility convert the position angles of points on the sphere into their 3D position vectors.

Location in HEALPix directory tree: src/idl/toolkit/ang2vec.pro 


FORMAT

IDL> ANG2VEC, Theta, Phi, Vector[, ASTRO=]


QUALIFIERS

Theta
input: scalar or vector,
colatitude in radians measured southward from north pole (in [0,$\pi$]).
If ASTRO is set, Theta is the latitude in degrees measured northward from the equator (in [-90, 90]).
Phi
input: scalar or vector of same size as Theta,
longitude in radians measured eastward (in [0, $2\pi$]).
If ASTRO is set, it is the longitude in degree measured eastward (in [0,360]).
Vector
output : array,
three dimensional cartesian position vector (x,y,z) normalised to unity. The north pole is (0,0,1). The coordinates are ordered as follows $x(0),\ldots,x(n-1),\ y(0),\ldots,y(n-1),\ z(0),\ldots,z(n-1)$


KEYWORDS

ASTRO=
if set Theta and Phi are the latitude and longitude in degrees instead of the colatitude and longitude in radians.


DESCRIPTION

ang2vec performs the geometrical transform from the position angles of points $(\theta,\phi)$ into their position vectors (x,y,z): $x = \sin\theta\cos\phi$, $y=\sin\theta\sin\phi$, $z=\cos\theta$


RELATED ROUTINES

This section lists the routines related to ang2vec

idl
version 6.4 or more is necessary to run ang2vec.
pix2xxx, ...
conversion between vector or angles and pixel index
vec2ang
conversion from position vectors to angles


EXAMPLE:

lat = -45 ; latitude in degrees  
long = 120 ; longitude in degrees  
ang2vec, lat, lon, /astro, vec  
will return in vec the 3D cartesian position vector of the point of latitude -45 deg and longitude 120 deg

Version 3.82, 2022-07-28