Documentation

This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

local2globalcoord

Convert local to global coordinates

Syntax

```gCoord = local2globalcoord(lclCoord,OPTION) gCoord = local2globalcoord(___,localOrigin) gCoord = local2globalcoord(___,localAxes) ```

Description

`gCoord = local2globalcoord(lclCoord,OPTION)` returns the global coordinate `gCoord` corresponding to the local coordinate `lclCoord`. `OPTION` determines the type of local-to-global coordinate transformation.

`gCoord = local2globalcoord(___,localOrigin)` specifies the origin of the local coordinate system.

`gCoord = local2globalcoord(___,localAxes)` specifies the axes of the local coordinate system.

Input Arguments

`lclCoord`

Local coordinates in rectangular or spherical coordinate form. `lclCoord` is a 3-by-1 vector or 3-by-N matrix. Each column represents a local coordinate.

If the coordinates are in rectangular form, the column represents (X,Y,Z) in meters.

If the coordinates are in spherical form, the column represents (az,el,r). az is the azimuth angle in degrees, el is the elevation angle in degrees, and r is the radius in meters.

`OPTION`

Types of coordinate transformations. Valid values are

OPTIONTransformation
`'rr'`Local rectangular to global rectangular
`'rs'`Local rectangular to global spherical
`'sr'`Local spherical to global rectangular
`'ss'`Local spherical to global spherical

`localOrigin`

Origin of local coordinate system. `localOrigin` is a 3-by-1 column vector containing the rectangular coordinate of the local coordinate system origin with respect to the global coordinate system.

Default: `[0; 0; 0]`

`localAxes`

Axes of local coordinate system. `localAxes` is a 3-by-3 matrix with the columns specifying the local X, Y, and Z axes in rectangular form with respect to the global coordinate system.

Default: `[1 0 0;0 1 0;0 0 1]`

Output Arguments

 `gCoord` Global coordinates in rectangular or spherical coordinate form. 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].

Examples

collapse all

Convert from local rectangular coordinates to global rectangular coordinates. The local coordinate origin is a (1,1,1)

`globalcoord = local2globalcoord([0;1;0], 'rr',[1;1;1])`
```globalcoord = 1 2 1 ```

Convert local spherical coordinate to global rectangular coordinate.

`globalcoord = local2globalcoord([30;45;4],'sr')`
```globalcoord = 2.4495 1.4142 2.8284 ```

More About

collapse all

Azimuth Angle, Elevation Angle

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.

Note

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.

References

[1] 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.

See Also

Introduced in R2011a

Was this topic helpful?

Hybrid Beamforming for Massive MIMO Phased Array Systems

Download the white paper