mpas_tools.transects.intersects¶
- mpas_tools.transects.intersects(a1, a2, b1, b2)[source]¶
- Based on https://stackoverflow.com/a/26669130/7728169 Determine if the great circle arc from - a1to- a2intersects that from- b1to- b2.- Parameters
- a1 (mpas_tools.transects.Vector) – Cartesian coordinates of the end points of two great circle arcs. The types of the attributes - x,- y, and- zmust either be- numpy.arraysof identical size for all 4 vectors (in which case intersections are found element-wise), or scalars for at least one of either- a1and- a2or- b1and- b2.
- a2 (mpas_tools.transects.Vector) – Cartesian coordinates of the end points of two great circle arcs. The types of the attributes - x,- y, and- zmust either be- numpy.arraysof identical size for all 4 vectors (in which case intersections are found element-wise), or scalars for at least one of either- a1and- a2or- b1and- b2.
- b1 (mpas_tools.transects.Vector) – Cartesian coordinates of the end points of two great circle arcs. The types of the attributes - x,- y, and- zmust either be- numpy.arraysof identical size for all 4 vectors (in which case intersections are found element-wise), or scalars for at least one of either- a1and- a2or- b1and- b2.
- b2 (mpas_tools.transects.Vector) – Cartesian coordinates of the end points of two great circle arcs. The types of the attributes - x,- y, and- zmust either be- numpy.arraysof identical size for all 4 vectors (in which case intersections are found element-wise), or scalars for at least one of either- a1and- a2or- b1and- b2.
 
- Returns
- intersect (numpy.array) – A boolean array of the same size as - a1and- a2or- b1and- b2, whichever is greater, indicating if the particular pair of arcs intersects