angle
Angle between sites
Description
[
returns the azimuth and elevation angles between az
,el
] = angle(site1,site2
)site1
and
site2
.
[
returns the angles using a specified path type, either a Euclidean or great circle
path.az
,el
] = angle(site1,site2
,path
)
[
returns the azimuth and elevation angles with additional options specified by
name-value arguments.az
,el
] = angle(___,Name,Value
)
Examples
Angle Between Sites
Create transmitter and receiver sites.
tx = txsite('Name','MathWorks','Latitude',42.3001,'Longitude',-71.3504); rx = rxsite('Name','Fenway Park','Latitude',42.3467,'Longitude',-71.0972);
Get the azimuth and elevation angles between the sites.
[az,el] = angle(tx,rx)
az = 14.0142
el = -0.2816
Get the azimuth angle between sites in degrees clockwise from north.
azFromEast = angle(tx,rx); % Unit: degrees counter-clockwise from east azFromNorth = -azFromEast + 90 % Convert angle to clockwise from north
azFromNorth = 75.9858
Angle Between Sites When Path is Great Circle
Create transmitter and receiver sites.
tx = txsite('Name','MathWorks','Latitude',42.3001,'Longitude',-71.3504); rx = rxsite('Name','Fenway Park','Latitude',42.3467,'Longitude',-71.0972);
Get the azimuth and elevation angles between the sites.
[az,el] = angle(tx,rx,'greatcircle')
az = 14.0635
el = 0
Input Arguments
path
— Measurement path type
'euclidean'
| 'greatcircle'
Measurement path type, specified as one of the following:
'euclidean'
— Use the shortest path through space connecting the antenna center positions of the sites.'greatcircle'
— Use the shortest path on the surface of the earth connecting the latitude and longitude locations of the sites. This path uses a spherical Earth model.
Data Types: char
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'Map','siteviewer1'
Map
— Map for visualization or surface data
siteviewer
object | triangulation
object | string scalar | character vector
Map for visualization or surface data, specified as a siteviewer
object, a triangulation
object, a string scalar, or a character vector.
Valid and default values depend on the coordinate system.
Coordinate System | Valid map values | Default map value |
---|---|---|
"geographic" |
|
|
"cartesian" |
|
|
a Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®. |
Data Types: char
| string
Output Arguments
az
— Azimuth angle between sites
M-by-N arrays
Azimuth angle between site1
and
site2
, returned as
M-by-N arrays in degrees.
M is the number of sites in
site1
and N is the number of
sites in site2
. The azimuth angle is expressed in
degrees counter-clockwise from the east (for geographic sites), or from the
global x-axis around the global z-axis (for Cartesian sites), ranging from
-180 to 180 degrees.
el
— Elevation angle between sites
M-by-N arrays
Elevation angle between site1
and
site2
, returned as
M-by-N arrays in degrees.
M is the number of sites in
site2
and N is the number of
sites in site1
. The elevation angle is expressed in
degrees from the horizontal (or X-Y) plane, ranging from -90 to 90
degrees.
When you specify the path type as 'greatcircle'
, the
elevation angle is always zero.
Version History
Introduced in R2017b
See Also
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)