pygeodesy 24.5.15__py2.py3-none-any.whl → 24.6.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.6.1.dist-info}/METADATA +6 -5
- PyGeodesy-24.6.1.dist-info/RECORD +116 -0
- pygeodesy/__init__.py +4 -4
- pygeodesy/albers.py +41 -41
- pygeodesy/auxilats/__init__.py +1 -1
- pygeodesy/auxilats/__main__.py +2 -2
- pygeodesy/auxilats/auxAngle.py +32 -31
- pygeodesy/auxilats/auxLat.py +80 -51
- pygeodesy/azimuthal.py +123 -124
- pygeodesy/basics.py +46 -10
- pygeodesy/booleans.py +13 -14
- pygeodesy/cartesianBase.py +25 -23
- pygeodesy/clipy.py +3 -3
- pygeodesy/constants.py +3 -3
- pygeodesy/css.py +50 -42
- pygeodesy/datums.py +42 -41
- pygeodesy/deprecated/functions.py +9 -3
- pygeodesy/dms.py +6 -6
- pygeodesy/ecef.py +41 -41
- pygeodesy/ellipsoidalBase.py +41 -41
- pygeodesy/ellipsoidalBaseDI.py +3 -4
- pygeodesy/ellipsoidalGeodSolve.py +2 -2
- pygeodesy/ellipsoidalKarney.py +3 -3
- pygeodesy/ellipsoidalNvector.py +11 -12
- pygeodesy/ellipsoids.py +45 -38
- pygeodesy/elliptic.py +3 -4
- pygeodesy/epsg.py +4 -3
- pygeodesy/errors.py +52 -20
- pygeodesy/etm.py +68 -65
- pygeodesy/fmath.py +44 -49
- pygeodesy/formy.py +129 -115
- pygeodesy/frechet.py +118 -103
- pygeodesy/fstats.py +21 -14
- pygeodesy/fsums.py +124 -80
- pygeodesy/gars.py +10 -9
- pygeodesy/geodesicw.py +19 -17
- pygeodesy/geodesicx/__init__.py +1 -1
- pygeodesy/geodesicx/__main__.py +2 -2
- pygeodesy/geodesicx/gx.py +39 -33
- pygeodesy/geodesicx/gxarea.py +12 -9
- pygeodesy/geodesicx/gxbases.py +3 -4
- pygeodesy/geodesicx/gxline.py +6 -8
- pygeodesy/geodsolve.py +29 -28
- pygeodesy/geohash.py +60 -57
- pygeodesy/geoids.py +34 -32
- pygeodesy/hausdorff.py +114 -101
- pygeodesy/heights.py +137 -130
- pygeodesy/internals.py +16 -11
- pygeodesy/interns.py +3 -6
- pygeodesy/iters.py +19 -17
- pygeodesy/karney.py +21 -17
- pygeodesy/ktm.py +25 -18
- pygeodesy/latlonBase.py +12 -11
- pygeodesy/lazily.py +6 -6
- pygeodesy/lcc.py +24 -25
- pygeodesy/ltp.py +143 -113
- pygeodesy/ltpTuples.py +207 -150
- pygeodesy/mgrs.py +26 -26
- pygeodesy/named.py +172 -90
- pygeodesy/namedTuples.py +33 -25
- pygeodesy/nvectorBase.py +8 -8
- pygeodesy/osgr.py +40 -48
- pygeodesy/points.py +18 -18
- pygeodesy/props.py +29 -16
- pygeodesy/rhumb/__init__.py +1 -1
- pygeodesy/rhumb/aux_.py +13 -15
- pygeodesy/rhumb/bases.py +12 -5
- pygeodesy/rhumb/ekx.py +24 -18
- pygeodesy/rhumb/solve.py +13 -10
- pygeodesy/simplify.py +16 -16
- pygeodesy/solveBase.py +18 -18
- pygeodesy/sphericalBase.py +17 -21
- pygeodesy/sphericalTrigonometry.py +21 -21
- pygeodesy/streprs.py +5 -5
- pygeodesy/trf.py +13 -11
- pygeodesy/triaxials.py +68 -64
- pygeodesy/units.py +35 -35
- pygeodesy/unitsBase.py +24 -11
- pygeodesy/ups.py +66 -70
- pygeodesy/utily.py +3 -3
- pygeodesy/utm.py +183 -187
- pygeodesy/utmups.py +38 -38
- pygeodesy/utmupsBase.py +104 -106
- pygeodesy/vector2d.py +6 -7
- pygeodesy/vector3d.py +16 -17
- pygeodesy/vector3dBase.py +4 -5
- pygeodesy/webmercator.py +43 -51
- PyGeodesy-24.5.15.dist-info/RECORD +0 -116
- {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.6.1.dist-info}/WHEEL +0 -0
- {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.6.1.dist-info}/top_level.txt +0 -0
pygeodesy/fmath.py
CHANGED
|
@@ -12,7 +12,7 @@ from pygeodesy.constants import EPS0, EPS02, EPS1, NAN, PI, PI_2, PI_4, \
|
|
|
12
12
|
_0_0, _0_125, _1_6th, _0_25, _1_3rd, _0_5, _1_0, \
|
|
13
13
|
_N_1_0, _1_5, _copysign_0_0, _isfinite, remainder
|
|
14
14
|
from pygeodesy.errors import _IsnotError, LenError, _TypeError, _ValueError, \
|
|
15
|
-
_xError,
|
|
15
|
+
_xError, _xkwds_get1, _xkwds_pop2
|
|
16
16
|
from pygeodesy.fsums import _2float, Fsum, fsum, fsum1_, _isFsumTuple, _1primed, \
|
|
17
17
|
Fmt, unstr
|
|
18
18
|
from pygeodesy.interns import MISSING, _negative_, _not_scalar_
|
|
@@ -24,7 +24,7 @@ from math import fabs, sqrt # pow
|
|
|
24
24
|
import operator as _operator # in .datums, .trf, .utm
|
|
25
25
|
|
|
26
26
|
__all__ = _ALL_LAZY.fmath
|
|
27
|
-
__version__ = '24.05.
|
|
27
|
+
__version__ = '24.05.29'
|
|
28
28
|
|
|
29
29
|
# sqrt(2) <https://WikiPedia.org/wiki/Square_root_of_2>
|
|
30
30
|
_0_4142 = 0.41421356237309504880 # ... sqrt(2) - 1
|
|
@@ -39,12 +39,13 @@ class Fdot(Fsum):
|
|
|
39
39
|
'''New L{Fdot} precision dot product M{sum(a[i] * b[i] for
|
|
40
40
|
i=0..len(a)-1)}.
|
|
41
41
|
|
|
42
|
-
@arg a: Iterable of values (each C{scalar} or an L{Fsum} or
|
|
43
|
-
|
|
44
|
-
@arg b: Other values (each C{scalar} or an L{Fsum} or L{Fsum2Tuple}
|
|
45
|
-
|
|
46
|
-
@kwarg name_RESIDUAL: Optional C{B{name}=NN} and C{B{RESIDUAL}=0.0}
|
|
47
|
-
threshold
|
|
42
|
+
@arg a: Iterable of values (each C{scalar} or an L{Fsum} or L{Fsum2Tuple}
|
|
43
|
+
instance).
|
|
44
|
+
@arg b: Other values (each C{scalar} or an L{Fsum} or L{Fsum2Tuple} instance),
|
|
45
|
+
all positional.
|
|
46
|
+
@kwarg name_RESIDUAL: Optional C{B{name}=NN} (C{str}) and the C{B{RESIDUAL}=0.0}
|
|
47
|
+
threshold (C{scalar}) for raising L{ResidualError}s, see class
|
|
48
|
+
L{Fsum<Fsum.__init__>}.
|
|
48
49
|
|
|
49
50
|
@raise LenError: Unequal C{len(B{a})} and C{len(B{b})}.
|
|
50
51
|
|
|
@@ -68,10 +69,11 @@ class Fhorner(Fsum):
|
|
|
68
69
|
i=0..len(cs)-1)}.
|
|
69
70
|
|
|
70
71
|
@arg x: Polynomial argument (C{scalar} or an L{Fsum} or L{Fsum2Tuple}).
|
|
71
|
-
@arg cs: Polynomial coeffients (each C{scalar} or an L{Fsum} or
|
|
72
|
-
|
|
73
|
-
@kwarg name_RESIDUAL: Optional C{B{name}=NN} and C{B{RESIDUAL}=0.0}
|
|
74
|
-
threshold
|
|
72
|
+
@arg cs: Polynomial coeffients (each C{scalar} or an L{Fsum} or L{Fsum2Tuple}
|
|
73
|
+
instance), all positional.
|
|
74
|
+
@kwarg name_RESIDUAL: Optional C{B{name}=NN} (C{str}) and the C{B{RESIDUAL}=0.0}
|
|
75
|
+
threshold (C{scalar}) for raising L{ResidualError}s, see class
|
|
76
|
+
L{Fsum<Fsum.__init__>}.
|
|
75
77
|
|
|
76
78
|
@raise OverflowError: Partial C{2sum} overflow.
|
|
77
79
|
|
|
@@ -83,19 +85,7 @@ class Fhorner(Fsum):
|
|
|
83
85
|
'''
|
|
84
86
|
Fsum.__init__(self, **name_RESIDUAL)
|
|
85
87
|
if cs:
|
|
86
|
-
|
|
87
|
-
_mul = self._mul_Fsum
|
|
88
|
-
else:
|
|
89
|
-
_mul = self._mul_scalar
|
|
90
|
-
x = _2float(x=x)
|
|
91
|
-
op = Fhorner.__name__
|
|
92
|
-
if len(cs) > 1 and x:
|
|
93
|
-
for c in reversed(cs):
|
|
94
|
-
self._fset_ps(_mul(x, op))
|
|
95
|
-
self._fadd(c, op, up=False)
|
|
96
|
-
self._update()
|
|
97
|
-
else: # x == 0
|
|
98
|
-
self._fadd(cs[0], op)
|
|
88
|
+
self._fhorner(x, cs, Fhorner.__name__)
|
|
99
89
|
else:
|
|
100
90
|
self._fset_ps(_0_0)
|
|
101
91
|
|
|
@@ -107,11 +97,12 @@ class Fhypot(Fsum):
|
|
|
107
97
|
'''New L{Fhypot} hypotenuse of (the I{root} of) several components
|
|
108
98
|
(raised to the power I{root}).
|
|
109
99
|
|
|
110
|
-
@arg xs: Components (each C{scalar} or an L{Fsum} or L{Fsum2Tuple}
|
|
111
|
-
|
|
112
|
-
@kwarg root_name_RESIDUAL_raiser: Optional, exponent and C{B{root}=2}
|
|
113
|
-
|
|
114
|
-
C{B{raiser}=True}
|
|
100
|
+
@arg xs: Components (each C{scalar} or an L{Fsum} or L{Fsum2Tuple} instance),
|
|
101
|
+
all positional.
|
|
102
|
+
@kwarg root_name_RESIDUAL_raiser: Optional, exponent and C{B{root}=2} order
|
|
103
|
+
(C{scalar}), C{B{name}=NN} (C{str}), the C{B{RESIDUAL}=0.0}
|
|
104
|
+
threshold (C{scalar}) and C{B{raiser}=True} (C{bool}) for
|
|
105
|
+
raising L{ResidualError}s, see class L{Fsum<Fsum.__init__>} and
|
|
115
106
|
method L{root<Fsum.root>}.
|
|
116
107
|
'''
|
|
117
108
|
r = None # _xkwds_pop2 error
|
|
@@ -134,10 +125,11 @@ class Fpolynomial(Fsum):
|
|
|
134
125
|
M{sum(cs[i] * x**i for i=0..len(cs)-1)}.
|
|
135
126
|
|
|
136
127
|
@arg x: Polynomial argument (C{scalar} or an L{Fsum} or L{Fsum2Tuple}).
|
|
137
|
-
@arg cs: Polynomial coeffients (each C{scalar} or an L{Fsum} or
|
|
138
|
-
|
|
139
|
-
@kwarg name_RESIDUAL: Optional C{B{name}=NN} and C{B{RESIDUAL}=0.0}
|
|
140
|
-
threshold
|
|
128
|
+
@arg cs: Polynomial coeffients (each C{scalar} or an L{Fsum} or L{Fsum2Tuple}
|
|
129
|
+
instance), all positional.
|
|
130
|
+
@kwarg name_RESIDUAL: Optional C{B{name}=NN} (C{str}) and the C{B{RESIDUAL}=0.0}
|
|
131
|
+
threshold (C{scalar}) for raising L{ResidualError}s, see class
|
|
132
|
+
L{Fsum<Fsum.__init__>}.
|
|
141
133
|
|
|
142
134
|
@raise OverflowError: Partial C{2sum} overflow.
|
|
143
135
|
|
|
@@ -162,11 +154,12 @@ class Fpowers(Fsum):
|
|
|
162
154
|
'''New L{Fpowers} sum of (the I{power} of) several bases.
|
|
163
155
|
|
|
164
156
|
@arg power: The exponent (C{scalar} or an L{Fsum} or L{Fsum2Tuple}).
|
|
165
|
-
@arg xs: One or more bases (each C{scalar} or an L{Fsum} or L{Fsum2Tuple}
|
|
166
|
-
|
|
167
|
-
@kwarg name_RESIDUAL_raiser: Optional C{B{name}=NN}, C{B{RESIDUAL}=0.0}
|
|
168
|
-
threshold and C{B{raiser}=True}
|
|
169
|
-
|
|
157
|
+
@arg xs: One or more bases (each C{scalar} or an L{Fsum} or L{Fsum2Tuple} instance),
|
|
158
|
+
all positional.
|
|
159
|
+
@kwarg name_RESIDUAL_raiser: Optional C{B{name}=NN} (C{str}), the C{B{RESIDUAL}=0.0}
|
|
160
|
+
threshold (C{scalar}) and C{B{raiser}=True} (C{bool}) for raising
|
|
161
|
+
L{ResidualError}s, see class L{Fsum<Fsum.__init__>} and method
|
|
162
|
+
L{fpow<Fsum.fpow>}.
|
|
170
163
|
'''
|
|
171
164
|
try:
|
|
172
165
|
raiser = _Fsum__init__(self, **name_RESIDUAL_raiser)
|
|
@@ -183,11 +176,12 @@ class Froot(Fsum):
|
|
|
183
176
|
'''New L{Froot} root of a precision sum.
|
|
184
177
|
|
|
185
178
|
@arg root: The order (C{scalar} or an L{Fsum} or L{Fsum2Tuple}), non-zero.
|
|
186
|
-
@arg xs: Items to summate (each a C{scalar} or an L{Fsum} or L{Fsum2Tuple}
|
|
187
|
-
|
|
188
|
-
@kwarg name_RESIDUAL_raiser: Optional C{B{name}=NN}, C{B{RESIDUAL}=0.0}
|
|
189
|
-
threshold and C{B{raiser}=True}
|
|
190
|
-
|
|
179
|
+
@arg xs: Items to summate (each a C{scalar} or an L{Fsum} or L{Fsum2Tuple} instance),
|
|
180
|
+
all positional.
|
|
181
|
+
@kwarg name_RESIDUAL_raiser: Optional C{B{name}=NN} (C{str}), the C{B{RESIDUAL}=0.0}
|
|
182
|
+
threshold (C{scalar}) and C{B{raiser}=True} (C{bool}) for raising
|
|
183
|
+
L{ResidualError}s, see class L{Fsum<Fsum.__init__>} and method
|
|
184
|
+
L{fpow<Fsum.fpow>}.
|
|
191
185
|
'''
|
|
192
186
|
try:
|
|
193
187
|
raiser = _Fsum__init__(self, **name_RESIDUAL_raiser)
|
|
@@ -337,8 +331,9 @@ def facos1(x):
|
|
|
337
331
|
if a < EPS0:
|
|
338
332
|
r = PI_2
|
|
339
333
|
elif a < EPS1:
|
|
340
|
-
H
|
|
341
|
-
|
|
334
|
+
H = Fhorner(-a, 1.5707288, 0.2121144, 0.0742610, 0.0187293)
|
|
335
|
+
H *= Fsqrt(_1_0, -a)
|
|
336
|
+
r = float(H)
|
|
342
337
|
if x < 0:
|
|
343
338
|
r = PI - r
|
|
344
339
|
else:
|
|
@@ -370,7 +365,7 @@ def fatan(x):
|
|
|
370
365
|
|
|
371
366
|
|
|
372
367
|
def fatan1(x):
|
|
373
|
-
'''Fast approximation of C{atan(B{x})} for C{0 <= B{x}
|
|
368
|
+
'''Fast approximation of C{atan(B{x})} for C{0 <= B{x} < 1}, I{unchecked}.
|
|
374
369
|
|
|
375
370
|
@see: U{ShaderFastLibs.h<https://GitHub.com/michaldrobot/ShaderFastLibs/
|
|
376
371
|
blob/master/ShaderFastMathLib.h>} and U{Efficient approximations
|
|
@@ -379,7 +374,7 @@ def fatan1(x):
|
|
|
379
374
|
IEEE Signal Processing Magazine, 111, May 2006.
|
|
380
375
|
'''
|
|
381
376
|
# Eq (9): PI_4 * x - x * (abs(x) - 1) * (0.2447 + 0.0663 * abs(x)), for -1 < x < 1
|
|
382
|
-
# PI_4 * x - (x**2 - x) * (0.2447 + 0.0663 * x), for 0 < x
|
|
377
|
+
# PI_4 * x - (x**2 - x) * (0.2447 + 0.0663 * x), for 0 < x < 1
|
|
383
378
|
# x * (1.0300981633974482 + x * (-0.1784 - x * 0.0663))
|
|
384
379
|
H = Fhorner(x, _0_0, 1.0300981634, -0.1784, -0.0663)
|
|
385
380
|
return float(H)
|
|
@@ -591,7 +586,7 @@ def fpolynomial(x, *cs, **over):
|
|
|
591
586
|
@see: Class L{Fpolynomial} for further details.
|
|
592
587
|
'''
|
|
593
588
|
P = Fpolynomial(x, *cs)
|
|
594
|
-
d =
|
|
589
|
+
d = _xkwds_get1(over, over=0) if over else 0
|
|
595
590
|
return P.fover(d) if d else float(P)
|
|
596
591
|
|
|
597
592
|
|