fabien van mook

all packages "fvm-*"

package "fvm-geometry"

function file "xyz2aer.m"

Function AER = xyz2aer(XYZ)
         AER = xyz2aer(XYZ,epsilon_el,epsilon_r)

returns the azimuth, elevation and radius of vectors
given by their x,y,z coordinates.

The matrices XYZ and AER contain a row for each vector,
and have obviously 3 columns.

The azimuth is the angle between the positive y axis and
the projection of the vector onto the x,y plane. The
azimuth is measured from the positive y axis and it is
positive in clockwise direction, as seen from a far point
on the the positive z axis. The azimuth is expressed in
degrees. The value of the output azimuth ranges from 0
(inclusively) to 360 (exclusively), or its value is NaN,
when the elevation is -90 or +90 degrees.

The elevation is the angle between the x,y plane and the
vector. The elevation is measured from the x,y plane, and
it is positive or negative, conforming to the sign of the
z component of the vector. The elevation is expressed in
degrees. The value of the output elevation ranges from -90
(inclusively) to +90 (inclusively) degrees.

When the calculated radius is about zero, NaN is output
for the corresponding azimuth and elevation.

The radius is the length of the vector.

The optional second argument epsilon_el is a scalar for the
maximal error allowed to consider an elevation equal to
-90 or +90 degrees. Its default is 1e-6.

The optional third argument epsilon_r is a scalar for the
maximal error allowed to consider a radius equal to zero.
Its default is calculated by "2*eps(class(r))", i.e.
depending on the machine precision of the variable r
containing the radius values.

The function internally calls the following non-standard
m-file:
-- aer2aer.m


(c) 2026 fabien van mook

2026.08.20 release of this file within package "fvm-geometry" under GNU GPLv3+