XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


selectlib (selectlib-4.77) [xmmsas_20230412_1735-21.0.0]

Vector operators and functions

A limited set of operators and functions to perform vector algebra in three-dimensional Eucledian space is available. The following table provides an overview over the available constructs:

description symbol/name type comment
vector construction vector(x, y, z) vector x/y/z can be arithmetic expressions
unit vector construction unitvector(x, y, z) vector norm(unitvector(x, y, z))==1
construction sky vector in J2000 reference frame skyvector(ra, dec) vector ra/dec Right Ascension/Declination in rad
unary minus ${\tt -}{\tt v}$ vector v vector
vector addition ${\tt v1}{\tt +}{\tt v2}$ vector v1/v2 vectors
vector subtraction ${\tt v1}{\tt -}{\tt v2}$ vector v1/v2 vectors
multiplication with scalar ${\tt s}{\tt *}{\tt v}$ vector v vector, s arithmetic expression
division by scalar ${\tt v}{\tt /}{\tt s}$ vector v vector, s arithmetic expression $\neq0$
cross product cross(v1, v2) vector v1/v2 vectors
vector component v[i] scalar $0<={\tt i}<=2$
vector norm norm(v) scalar equivalent to sqrt(v[0]**2+v[1]**2+v[2]**2)
scalar product ${\tt v1}{\tt *}{\tt v2}$ scalar equivalent to v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]
Example expressions involving vector algebra:

XMM-Newton SOC -- 2023-04-16