Main Content

gcxgc

十字路口阿宝ints for pairs of great circles

Description

example

[lat,lon] = gcxgc(lat1,lon1,az1,lat2,lon2,az2)returns inlatandlonthe locations where pairs of great circles intersect. The great circles are defined usinggreat circle notation, which consists of a point on the great circle and the azimuth at that point along which the great circle proceeds. For example, the first great circle in a pair would pass through the point (lat1,lon1) with an azimuth ofaz1(in angular units).

For any pair of great circles, there are two possible intersection conditions: the circles are identical or they intersect exactly twice on the sphere.

[lat,lon] = gcxgc(lat1,lon1,az1,lat2,lon2,az2,units)specifies the angular units used for all inputs, whereunitsis any valid angular unit.

latlon= gcxgc(___)returns a single output consisting of the concatenated latitude and longitude coordinates of the great circle intersection points.

Examples

Find Intersection Points of Two Great Circles

Given a great circle passing through (10ºN,13ºE) and proceeding on an azimuth of 10º, where does it intersect with a great circle passing through (0º, 20ºE), on an azimuth of -23º (that is, 337º)?

[newlat,newlon] = gcxgc(10,13,10,0,20,-23)
newlat = 14.3105 -14.3105 newlon = 13.7838 -166.2162

Note that the two intersection points are always antipodes of each other. As a simple example, consider the intersection points of two meridians, which are just great circles with azimuths of 0º or 180º:

[newlat,newlon] = gcxgc(10,13,0,0,20,180)
newlat = -90 90 newlon = 0 180

The two meridians intersect at the North and South Poles, which is exactly correct.

Input Arguments

collapse all

Latitude or longitude coordinate of a point on the first great circle in each pair, specified as one of these values.

  • A numeric scalar to find the intersection of a single pair of great circles.

  • An-element numeric vector to find the intersection ofnpairs of great circles.

lat1andlon1must have the same length.

Example:10

Example:[-10 20 90 -45]

Azimuth of the first great circle of each pair, in angular units, specified as one of these values.

  • A positive numeric scalar to find the intersection of a single pair of great circles.

  • An积极的n元向量umbers to find the intersection ofnpairs of great circles. The length ofaz1matches the length oflat1andlon1.

Example:20

Example:[20 10 45 45]

Latitude or longitude coordinate of a point on the second great circle in each pair, specified as one of these values.

  • A numeric scalar to find the intersection of a single pair of great circles.

  • An-element numeric vector to find the intersection ofnpairs of great circles.

lat2andlon2must have the same length aslat1andlon1.

Example:3

Example:[3 30 85 -45]

Azimuth of the second great circle of each pair, in angular units, specified as one of these values.

  • A positive numeric scalar to find the intersection of a single pair of great circles.

  • An积极的n元向量umbers to find the intersection ofnpairs of great circles. The length ofaz2matches the length oflat2andlon2.

Example:15

Example:[15 15 45 50]

Angular units, specified as'degrees'or“弧度”.

Output Arguments

collapse all

Coordinates of great circle intersections, returned as one of the following.

  • 2-element vector when you find the intersection of a single pair of great circles.

  • n-by-2 matrix when you find the intersection ofnpairs of great circles.

If a pair of great circles are identical, thengcxgcdisplays a warning and returnsNaNs for the latitude and longitude coordinates of the intersection points.

Concatenated coordinates of great circle intersections, returned as one of the following. This output is identical to [latlon].

  • 4-element vector when you find the intersection of a single pair of great circles.

  • n-by-4 matrix when you find the intersection ofnpairs of great circles.

If a pair of great circles are identical, thengcxgcdisplays a warning and returnsNaNs for the latitude and longitude coordinates of the intersection points.

Version History

Introduced before R2006a