mpas_tools.vector.Vector.straddles
- static Vector.straddles(a1, a2, b1, b2)[source]
Based on https://stackoverflow.com/a/26669130/7728169 Determines if the great circle segment determined by (a1, a2) straddles the great circle determined by (b1, b2)
- Parameters:
a1 (mpas_tools.vector.Vector) – Cartesian coordinates of first end point of first great circle arc. The types of the attributes
x
,y
, andz
must either benumpy.arrays
of identical size for all 4 vectors (in which case intersections are found element-wise), or scalars for at least one of either the a’s or the b’s.a2 (mpas_tools.vector.Vector) – Second end point of first great circle arc.
b1 (mpas_tools.vector.Vector) – First end point of second great circle arc.
b2 (mpas_tools.vector.Vector) – Second end point of second great circle arc.
- Returns:
straddle (numpy.ndarray) – A boolean array of the same size as the a’s or the b’s, whichever is greater, indicating if the great circle segment determined by (a1, a2) straddles the great circle determined by (b1, b2)