: lat, lon = gcxgc (lat1, lon1, az1, lat2, lon2, az2)
: lat, lon = gcxgc (lat1, lon1, az1, lat2, lon2, az2, angleUnit)
: lat, lon, idl = gcxgc (…)
: latlon = gcxgc (…)

Determines the intersection points between two great circles.

Input:

  • lat1, lon1, az1: latitude, longitude, and azimuth of great circle #1. These must be scalar values or vectors of equal length.
  • lat2, lon2, az2: latitude, longitude, and azimuth of great circle #2. These must be scalar values or vectors of equal length.
  • angleUnit: string for angular units (’degrees’ or ’radians’, case-insensitive, just the first character will do). Default is ’degrees’. angleUnit applies to all inputs and outputs.

Output:
The shape of the output depends on the number of requested outputs.

  • If two outputs were requested: If scalar values have been input, lat and lon are both 1x2 vectors. If vectors have been input lat and lon are Nx2 arrays where N is the number of great circle pairs. The results for multiple great circle pairs are concatenated vertically no matter the orientation of input vectors.
  • If just one output was requested, the lat and lon values are concatenated into an Nx4 array, where N is 1 in case of scalar inputs and in case in input vector(s) N is the size of them.
  • If three outputs were requested the first two output are lat and lon, third output st lists pairs of coinciding great circles, if any. In this case warnings for coinciding circles are suppressed.

Example:

lat1 = 51.8853;
lon1 = 0.2545;
az1  = 108.55;
lat2 = 49.0034;
lon2 =  2.5735;
az2  =  32.44;
[newlat, newlon] = gcxgc (lat1, lon1, az1, lat2, lon2, az2)
newlat =
  50.908  -50.908
newlon =
    4.5086  -175.4914

Package: mapping