Determines the intersection points between two small circles.
Input:
- lat1, lon1, r1: latitude, longitude, and range of
small circle #1 in angular units. These must be scalar values or vectors
of equal length.
- lat2, lon2, r2: latitude, longitude, and range of
small circle #2 in the same angular units as small circle #1. 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.
Outputs:
- lat and lon are both Nx2 vectors of latitude(s) and longitude(s)
of the intersection point(s). Circle pair(s) that have no intersection
points or happen to lie on the same axis (identical or antipodal centers)
NaN values are returned.
- Optional third output istn, if present, turns off warnings for
coinciding circles or no intersections. It is an Nx1 vector indicating
the intersection situation of each input pair of circles, with for each
circle pair the values:
- 0
The pair of circles has two distinct intersection points.
- 1
The circles have identical axis, so are either coinciding or don’t have
any intersection points.
- 2
The pair of circles have just one common intersection point (tangent).
- 3
The pair of circles are disjoint, have no intersection points.
Example:
lat1 = 37.67;
lon1 = -90.2;
rng1 = 1.79;
lat2 = 36.11;
lon2 = -90.95;
rng2 = 2.42;
[newlat, newlon] = scxsc (lat1, lon1, rng1, lat2, lon2, rng2)
newlat =
36.964 38.260
newlon =
-88.132 -92.343
Coinciding, tangent, non-intersecting and intersecting circles:
[lat, lon, w] = scxsc (0, 0, 1, 0, [0, 2, 0, 2], [1, 1, 2, 1.5])
lat =
NaN NaN
0 0
NaN NaN
0.7262 -0.7262
lon =
NaN NaN
1.0000 1.0000
NaN NaN
0.6875 0.6875
w =
3
2
1
0
See also: gcxgc, gcxsc, gc2sc.