mpas_tools.transects.Vector
- class mpas_tools.transects.Vector(x, y, z)[source]
A class for representing Cartesian vectors with
x
,y
andz
components that are eitherfloat
ornumpy.array
objects of identical size.- Variables:
x (float or numpy.ndarray) – The x component(s)
y (float or numpy.ndarray) – The y component(s)
z (float or numpy.ndarray) – The z component(s)
- __init__(x, y, z)[source]
A class for representing Cartesian vectors with
x
,y
andz
components that are eitherfloat
ornumpy.array
objects of identical size.- Parameters:
x (float or numpy.ndarray) – The x component(s)
y (float or numpy.ndarray) – The y component(s)
z (float or numpy.ndarray) – The z component(s)
Methods
__init__
(x, y, z)A class for representing Cartesian vectors with
x
,y
andz
components that are eitherfloat
ornumpy.array
objects of identical size.angular_distance
(other)Compute angular distance between points on the sphere, following: https://en.wikipedia.org/wiki/Great-circle_distance
cross
(other)Compute the dot product between this vector and
other
.det
(v1, v2, v3)The determinant of the matrix defined by the three
Vector
objectsdot
(other)Compute the dot product between this vector and
other
.intersection
(a1, a2, b1, b2)Based on https://stackoverflow.com/a/26669130/7728169 Find the intersection point as a unit vector between great circle arc from
a1
toa2
and fromb1
tob2
.intersects
(a1, a2, b1, b2)Based on https://stackoverflow.com/a/26669130/7728169 Determine if the great circle arc from
a1
toa2
intersects that fromb1
tob2
.mag
()The magnitude of the vector
straddles
(a1, a2, b1, b2)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)