mpas_tools.vector.Vector.intersects¶
- static Vector.intersects(a1, a2, b1, b2)[source]¶
Based on https://stackoverflow.com/a/26669130/7728169 Determine if the great circle arc from
a1
toa2
intersects that fromb1
tob2
.- Parameters:
a1 (mpas_tools.vector.Vector) – Cartesian coordinates of the end point of a 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 eithera1
anda2
orb1
andb2
.a2 (mpas_tools.vector.Vector) – Cartesian coordinates of the other end point of a great circle arc.
b1 (mpas_tools.vector.Vector) – Cartesian coordinates of an end point of a second great circle arc.
b2 (mpas_tools.vector.Vector) – Cartesian coordinates of the other end point of the second great circle arc.
- Returns:
intersect (numpy.ndarray) – A boolean array of the same size as
a1
anda2
orb1
andb2
, whichever is greater, indicating if the particular pair of arcs intersects