Angle between sites
[
returns the azimuth and elevation angles between site 1 and siteaz
,el
] = angle(site1,site2
)
[
returns the angles using a specified path type, either Euclidean or great circle
path.az
,el
] = angle(site1,site2
,path
)
[
returns the azimuth and elevation angles with additional options specified by
name-value pairs.az
,el
] = angle(___,Name,Value
)
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
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
path
— Measurement path type'euclidean'
or
'greatcircle'
Measurement path type, specified as one of the following:
'euclidean'
: Uses the shortest path through
space connecting the antenna center positions of the site 1 and
site 2.
'greatcircle'
: Uses the shortest path on
the surface of the earth connecting the latitude and longitude
locations of site 1 and site 2. This path uses a spherical Earth
model.
Data Types: char
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
'Map','siteviewer1'
'Map'
— Map for visualization or surface datasiteviewer
object | terrain nameMap for visualization or surface data, specified as the comma-separated pair
consisting of 'Map
and one of the following depending on the
coordinate system:
Coordinate System | Valid map values | Default map value |
---|---|---|
'geographic' |
|
|
'cartesian' | 'none' , triangulation object or name of an STL
file. | 'none' |
[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
az
— Azimuth angle between site 1 and site 2Azimuth angle between site 1 and site 2, returned as M-by-N arrays in degrees. M is the number of sites in sites 2 and N is the number of sites in sites 1. 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
el
— Elevation angle between site 1 and site 2Elevation angle between site 1 and site 2, returned as M-by-N arrays in degrees. M is the number of sites in sites 2 and N is the number of sites in sites 1 The elevation angle is expressed in degrees from the horizontal (or X-Y) plane, ranging from -90 to 90.
When the path type specified is 'greatcircle'
,
elevation angle is always zero.
You have a modified version of this example. Do you want to open this example with your edits?