A variation of Matlab's cart2sph, that transforms a vector of Cartesian coordinates (East, North, Up) to radar coordinates (Range, Azimuth, Elevation). Note the different definition of radar coords vs. spherical coords, which require this different function (see exact definitions within the help comment).
input format #1: [...] = xyz2rae(x,y,z)
input format #2: [...] = xyz2rae(xyz)
output format #1: [range, azimuth, elevation] = xyz2rae(...)
output format #2: rae = xyz2rae(...)
The input coordinates may be either singular values or a vector of coordinate points.
Use the corresponding rae2xyz function for the reverse transformation.
Note: xyz2rae does NOT take into account earth curvature, Ionosphere beam curving etc. - this simple function uses a simple flat-earth free-space model. |