|
6 | 6 |
|
7 | 7 | import warnings |
8 | 8 |
|
9 | | -from ._typing import FloatArray, FloatLike |
10 | 9 | import logging |
11 | 10 | from copy import copy |
12 | 11 |
|
13 | 12 | from .ellipsoid import Ellipsoid, resolve_ellipsoid |
14 | 13 | from .mathfun import isnan, linspace, degrees, radians, sign, sqrt, atan2, cos, sin, tan, asin, atan |
15 | 14 | from math import pi, tau, nan |
16 | 15 |
|
| 16 | +try: |
| 17 | + from numpy import asarray |
| 18 | +except ImportError: |
| 19 | + pass |
| 20 | + |
| 21 | + |
17 | 22 | __all__ = ["vdist", "vreckon", "track2"] |
18 | 23 |
|
19 | 24 |
|
@@ -447,7 +452,8 @@ def track2( |
447 | 452 | deg: bool = True, |
448 | 453 | ) -> tuple: |
449 | 454 | """ |
450 | | - computes great circle tracks starting at the point lat1, lon1 and ending at lat2, lon2 |
| 455 | + computes great circle tracks starting at the point lat1, lon1 and ending at lat2, lon2. |
| 456 | + track2() REQUIRES NumPy. |
451 | 457 |
|
452 | 458 | Parameters |
453 | 459 | ---------- |
@@ -501,7 +507,7 @@ def track2( |
501 | 507 | distance, azimuth = vdist(lat1, lon1, lat2, lon2, ell, deg=False) |
502 | 508 | dists = linspace(0, distance, npts) |
503 | 509 |
|
504 | | - lats, lons = vreckon(lat1, lon1, dists, azimuth, ell, deg=False) |
| 510 | + lats, lons = vreckon(lat1, lon1, asarray(dists), azimuth, ell, deg=False) |
505 | 511 |
|
506 | 512 | if deg: |
507 | 513 | lats = degrees(lats) |
|
0 commit comments