angle
Angle between sites
Description
[
specifies options using name-value arguments.az
,el
] = angle(___,Name=Value
)
Examples
Calculate Azimuth and Elevation Angles Between Sites
Create a transmitter site and a receiver site. Specify the locations using geographic coordinates.
tx = txsite(Name="MathWorks", ... Latitude=42.3001, ... Longitude=-71.3504); rx = rxsite(Name="Fenway Park", ... Latitude=42.3467, ... Longitude=-71.0972);
Calculate the azimuth and elevation angles between the sites. By default, the function uses a Euclidean path between the sites.
[az,el] = angle(tx,rx)
az = 14.0142
el = -0.2805
For geographic sites, the function returns the azimuth angle in degrees, measured counterclockwise from the east. Convert the azimuth angle so that it is measured clockwise from the north.
azFromEast = az; % degrees counterclockwise from east azFromNorth = -azFromEast + 90 % degrees clockwise from north
azFromNorth = 75.9858
Calculate Angles Using Great Circle Path
Create a transmitter site and a receiver site. Specify the locations using geographic coordinates.
tx = txsite(Name="MathWorks", ... Latitude=42.3001, ... Longitude=-71.3504); rx = rxsite(Name="Fenway Park", ... Latitude=42.3467, ... Longitude=-71.0972);
Calculate the azimuth and elevation angles between the sites using a great circle path.
[az,el] = angle(tx,rx,"greatcircle")
az = 14.0635
el = 0
Input Arguments
path
— Measurement path type
"euclidean"
(default) | "greatcircle"
Measurement path type, specified as one of the following:
"euclidean"
— Use the shortest path through space that connects the antenna center positions of the sites. The option is the default for both Cartesian and geographic sites."greatcircle"
— Use the shortest path on the surface of a spherical Earth that connects the geographic locations of the sites. This option requires theCoordinateSystem
properties of the sites to be"geographic"
.
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.
Example: [az,el] = angle(site1,site2,"Map","myfile.stl")
specifies the map as an STL file.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: [az,el] = angle(site1,site2,Map="myfile.stl")
specifies
the map as an STL file.
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®. |
In most cases, if you specify this argument as a value other than a siteviewer
or
"none"
, then you must also specify an output argument.
Data Types: char
| string
Output Arguments
az
— Azimuth angle between sites, in degrees
M-by-N array
Azimuth angle between the sites, in degrees, returned as an
M-by-N array, where
M is the number of sites in
site1
and N is the number of
sites in site2
.
For geographic sites, the azimuth angle is measured counterclockwise from the east. For Cartesian sites, the azimuth angle is measured from the global x-axis around the global z-axis. The angle is in the range [–180, 180] degrees.
el
— Elevation angle between sites, in degrees
M-by-N array
Elevation angle between the sites, in degrees, returned as an
M-by-N array. M
is the number of sites in site2
and
N is the number of sites in
site1
.
The elevation angle is measured from the horizontal (or xy) plane. The angle is in the range [–90, 90] degrees.
When you specify the path type as "greatcircle"
, the
elevation angle is 0
.
Version History
Introduced in R2017b
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)