Convert global to local coordinates
lclCoord = global2localcoord(gCoord, OPTION)
gCoord = global2localcoord(___,localOrigin)
gCoord = global2localcoord(___,localAxes)
the local coordinate
lclCoord = global2localcoord(
lclCoord corresponding to
the global coordinate
the type of global-to-local coordinate transformation.
Global coordinates in rectangular or spherical coordinate form.
If the coordinates are in rectangular form, the column represents (X,Y,Z) in meters.
The origin of the global coordinate system is at [0; 0; 0]. That system’s axes are the standard unit basis vectors in three-dimensional space, [1; 0; 0], [0; 1; 0], and [0; 0; 1].
Type of coordinate transformation. Valid types are
Origin of local coordinate system.
Axes of local coordinate system.
Local coordinates in rectangular or spherical coordinate form.
Convert global rectangular coordinates, (0,1,0), to local rectangular coordinates. The local coordinate origin is (1,1,1).
lclCoord = global2localcoord([0;1;0],'rr',[1;1;1])
lclCoord = -1 0 -1
Convert global spherical coordinates to local rectangular coordinates.
lclCoord = global2localcoord([45;45;50],'sr',[50;50;50])
lclCoord = -25.0000 -25.0000 -14.6447
The azimuth angle of a vector is the angle between the x-axis and the orthogonal projection of the vector onto the xy plane. The angle is positive in going from the x axis toward the y axis. Azimuth angles lie between –180 and 180 degrees. The elevation angle is the angle between the vector and its orthogonal projection onto the xy-plane. The angle is positive when going toward the positive z-axis from the xy plane. These definitions assume the boresight direction is the positive x-axis.
The elevation angle is sometimes defined in the literature as the angle a vector makes with the positive z-axis. The MATLAB® and Phased Array System Toolbox™ products do not use this definition.
This figure illustrates the azimuth angle and elevation angle for a vector that appears as a green solid line. The coordinate system is relative to the center of a uniform linear array, whose elements appear as blue circles.
 Foley, J. D., A. van Dam, S. K. Feiner, and J. F. Hughes. Computer Graphics: Principles and Practice in C, 2nd Ed. Reading, MA: Addison-Wesley, 1995.
Usage notes and limitations:
Does not support variable-size inputs.