clouddrift.sphere.cumulative_distance

clouddrift.sphere.cumulative_distance#

clouddrift.sphere.cumulative_distance(longitude: list | ndarray | DataArray, latitude: list | ndarray | DataArray) ndarray[source]#

Return the cumulative great circle distance in meters along a sequence of geographical locations.

Parameters#

latitudearray-like

Latitude sequence, in degrees.

longitudearray-like

Longitude sequence, in degrees.

Returns#

outnp.ndarray

Cumulative distance.

See Also#

distance()

Examples#

Calculate the cumulative distance in meters along a path of three points:

>>> cumulative_distance(np.array([0, 1, 2]), np.array([0, 1, 2]))
array([     0.        , 157424.62387233, 314825.27182116])