pygeodesy 24.6.1__py2.py3-none-any.whl → 24.6.24__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.
Files changed (89) hide show
  1. {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.24.dist-info}/METADATA +2 -2
  2. PyGeodesy-24.6.24.dist-info/RECORD +117 -0
  3. pygeodesy/__init__.py +33 -32
  4. pygeodesy/albers.py +2 -2
  5. pygeodesy/auxilats/__init__.py +1 -1
  6. pygeodesy/auxilats/auxAngle.py +40 -39
  7. pygeodesy/auxilats/auxDLat.py +3 -2
  8. pygeodesy/auxilats/auxLat.py +16 -18
  9. pygeodesy/auxilats/auxily.py +1 -1
  10. pygeodesy/azimuthal.py +10 -10
  11. pygeodesy/basics.py +9 -1
  12. pygeodesy/booleans.py +53 -66
  13. pygeodesy/cartesianBase.py +143 -155
  14. pygeodesy/css.py +14 -18
  15. pygeodesy/datums.py +6 -6
  16. pygeodesy/deprecated/__init__.py +1 -1
  17. pygeodesy/deprecated/classes.py +16 -2
  18. pygeodesy/deprecated/datum.py +3 -3
  19. pygeodesy/deprecated/functions.py +6 -8
  20. pygeodesy/dms.py +23 -27
  21. pygeodesy/ecef.py +49 -55
  22. pygeodesy/elevations.py +4 -4
  23. pygeodesy/ellipsoidalBase.py +28 -70
  24. pygeodesy/ellipsoidalBaseDI.py +19 -23
  25. pygeodesy/ellipsoidalExact.py +3 -3
  26. pygeodesy/ellipsoidalGeodSolve.py +15 -23
  27. pygeodesy/ellipsoidalKarney.py +37 -60
  28. pygeodesy/ellipsoidalNvector.py +44 -50
  29. pygeodesy/ellipsoidalVincenty.py +11 -14
  30. pygeodesy/ellipsoids.py +107 -101
  31. pygeodesy/errors.py +101 -49
  32. pygeodesy/etm.py +32 -44
  33. pygeodesy/formy.py +55 -58
  34. pygeodesy/frechet.py +20 -23
  35. pygeodesy/fsums.py +4 -4
  36. pygeodesy/gars.py +3 -4
  37. pygeodesy/geodesici.py +909 -0
  38. pygeodesy/geodesicw.py +11 -13
  39. pygeodesy/geodesicx/__init__.py +4 -4
  40. pygeodesy/geodesicx/gx.py +18 -28
  41. pygeodesy/geodesicx/gxbases.py +20 -8
  42. pygeodesy/geodesicx/gxline.py +16 -22
  43. pygeodesy/geodsolve.py +102 -34
  44. pygeodesy/geohash.py +39 -60
  45. pygeodesy/geoids.py +28 -37
  46. pygeodesy/hausdorff.py +21 -23
  47. pygeodesy/heights.py +15 -28
  48. pygeodesy/internals.py +19 -12
  49. pygeodesy/interns.py +4 -10
  50. pygeodesy/iters.py +2 -2
  51. pygeodesy/karney.py +20 -4
  52. pygeodesy/ktm.py +13 -16
  53. pygeodesy/latlonBase.py +202 -191
  54. pygeodesy/lazily.py +96 -59
  55. pygeodesy/lcc.py +29 -32
  56. pygeodesy/ltp.py +43 -24
  57. pygeodesy/ltpTuples.py +190 -183
  58. pygeodesy/mgrs.py +35 -9
  59. pygeodesy/named.py +106 -72
  60. pygeodesy/namedTuples.py +43 -14
  61. pygeodesy/nvectorBase.py +23 -27
  62. pygeodesy/osgr.py +9 -9
  63. pygeodesy/points.py +7 -7
  64. pygeodesy/rhumb/__init__.py +1 -1
  65. pygeodesy/rhumb/aux_.py +5 -5
  66. pygeodesy/rhumb/bases.py +30 -31
  67. pygeodesy/rhumb/ekx.py +3 -4
  68. pygeodesy/rhumb/solve.py +8 -61
  69. pygeodesy/solveBase.py +22 -19
  70. pygeodesy/sphericalBase.py +26 -21
  71. pygeodesy/sphericalNvector.py +13 -13
  72. pygeodesy/sphericalTrigonometry.py +86 -97
  73. pygeodesy/streprs.py +8 -36
  74. pygeodesy/trf.py +3 -3
  75. pygeodesy/triaxials.py +117 -91
  76. pygeodesy/units.py +229 -321
  77. pygeodesy/unitsBase.py +116 -108
  78. pygeodesy/ups.py +26 -31
  79. pygeodesy/utily.py +12 -11
  80. pygeodesy/utm.py +35 -40
  81. pygeodesy/utmups.py +43 -46
  82. pygeodesy/utmupsBase.py +9 -10
  83. pygeodesy/vector3d.py +59 -62
  84. pygeodesy/vector3dBase.py +17 -15
  85. pygeodesy/webmercator.py +19 -21
  86. pygeodesy/wgrs.py +18 -20
  87. PyGeodesy-24.6.1.dist-info/RECORD +0 -116
  88. {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.24.dist-info}/WHEEL +0 -0
  89. {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.24.dist-info}/top_level.txt +0 -0
pygeodesy/triaxials.py CHANGED
@@ -35,7 +35,6 @@ from pygeodesy.constants import EPS, EPS0, EPS02, EPS4, INT0, PI2, PI_3, PI4, \
35
35
  _EPS2e4, float0_, isfinite, isnear1, _0_0, _0_5, \
36
36
  _1_0, _N_1_0, _N_2_0, _4_0 # PYCHOK used!
37
37
  from pygeodesy.datums import Datum, _spherical_datum, _WGS84, Ellipsoid, _EWGS84, Fmt
38
- # from pygeodesy.dms import toDMS # _MODS
39
38
  # from pygeodesy.ellipsoids import Ellipsoid, _EWGS84 # from .datums
40
39
  # from pygeodesy.elliptic import Elliptic # _MODS
41
40
  # from pygeodesy.errors import _ValueError # from .basics
@@ -47,38 +46,49 @@ from pygeodesy.interns import NN, _a_, _b_, _beta_, _c_, _distant_, _finite_, \
47
46
  _spherical_, _too_, _x_, _y_
48
47
  # from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS # from .vector3d
49
48
  from pygeodesy.named import _lazyNamedEnumItem as _lazy, _name__, _NamedEnum, \
50
- _NamedEnumItem, _NamedTuple, _Pass
51
- from pygeodesy.namedTuples import LatLon3Tuple, Vector3Tuple, Vector4Tuple
49
+ _NamedEnumItem, _Pass
50
+ from pygeodesy.namedTuples import LatLon3Tuple, _NamedTupleTo, Vector3Tuple, \
51
+ Vector4Tuple
52
52
  from pygeodesy.props import Property_RO, property_RO
53
53
  # from pygeodesy.streprs import Fmt # from .datums
54
- from pygeodesy.units import Float, Height_, Meter, Meter2, Meter3, Radians, \
55
- Radius, Scalar_, _toDegrees, _toRadians
54
+ from pygeodesy.units import Degrees, Float, Height_, Meter, Meter2, Meter3, \
55
+ Radians, Radius, Scalar_
56
56
  from pygeodesy.utily import asin1, atan2d, km2m, m2km, SinCos2, sincos2d_
57
57
  from pygeodesy.vector3d import _otherV3d, Vector3d, _ALL_LAZY, _MODS
58
58
 
59
59
  from math import atan2, fabs, sqrt
60
60
 
61
61
  __all__ = _ALL_LAZY.triaxials
62
- __version__ = '24.05.28'
62
+ __version__ = '24.06.24'
63
63
 
64
64
  _not_ordered_ = _not_('ordered')
65
65
  _omega_ = 'omega'
66
66
  _TRIPS = 269 # 48-55, Eberly 1074?
67
67
 
68
68
 
69
- class _NamedTupleTo(_NamedTuple): # in .testNamedTuples, like .cartesianBase.RadiusThetaPhi3Tuple
70
- '''(INTERNAL) Base for C{-.toDegrees}, C{-.toRadians}.
69
+ class _NamedTupleToX(_NamedTupleTo): # in .testNamedTuples
70
+ '''(INTERNAL) Base class for L{BetaOmega2Tuple},
71
+ L{BetaOmega3Tuple} and L{Jacobi2Tuple}.
71
72
  '''
72
- def _toDegrees(self, a, b, *c, **toDMS_kwds):
73
- a, b, _ = _toDegrees(self, a, b, **toDMS_kwds)
74
- return _ or self.classof(a, b, *c, name=self.name)
73
+ def _toDegrees(self, name, **toDMS_kwds):
74
+ '''(INTERNAL) Convert C{self[0:2]} to L{Degrees} or C{toDMS}.
75
+ '''
76
+ return self._toX3U(_NamedTupleTo._Degrees3, Degrees, name, *self, **toDMS_kwds)
77
+
78
+ def _toRadians(self, name):
79
+ '''(INTERNAL) Convert C{self[0:2]} to L{Radians}.
80
+ '''
81
+ return self._toX3U(_NamedTupleTo._Radians3, Radians, name, *self)
75
82
 
76
- def _toRadians(self, a, b, *c):
77
- a, b, _ = _toRadians(self, a, b)
78
- return _ or self.classof(a, b, *c, name=self.name)
83
+ def _toX3U(self, _X3, U, name, a, b, *c, **kwds):
84
+ a, b, s = _X3(self, a, b, **kwds)
85
+ if s is None or name:
86
+ n = self._name__(name)
87
+ s = self.classof(a, b, *c, name=n).reUnit(U, U).toUnits()
88
+ return s
79
89
 
80
90
 
81
- class BetaOmega2Tuple(_NamedTupleTo):
91
+ class BetaOmega2Tuple(_NamedTupleToX):
82
92
  '''2-Tuple C{(beta, omega)} with I{ellipsoidal} lat- and
83
93
  longitude C{beta} and C{omega} both in L{Radians} (or
84
94
  L{Degrees}).
@@ -86,27 +96,30 @@ class BetaOmega2Tuple(_NamedTupleTo):
86
96
  _Names_ = (_beta_, _omega_)
87
97
  _Units_ = (_Pass, _Pass)
88
98
 
89
- def toDegrees(self, **toDMS_kwds):
99
+ def toDegrees(self, name=NN, **toDMS_kwds):
90
100
  '''Convert this L{BetaOmega2Tuple} to L{Degrees} or C{toDMS}.
91
101
 
92
- @return: L{BetaOmega2Tuple}C{(beta, omega)} with
93
- C{beta} and C{omega} both in L{Degrees}
94
- or as a L{toDMS} string provided some
95
- B{C{toDMS_kwds}} keyword arguments are
102
+ @kwarg name: Optional name (C{str}), overriding this name.
103
+
104
+ @return: L{BetaOmega2Tuple}C{(beta, omega)} with C{beta} and
105
+ C{omega} both in L{Degrees} or as L{toDMS} strings
106
+ provided some B{C{toDMS_kwds}} keyword arguments are
96
107
  specified.
97
108
  '''
98
- return _NamedTupleTo._toDegrees(self, *self, **toDMS_kwds)
109
+ return self._toDegrees(name, **toDMS_kwds)
99
110
 
100
- def toRadians(self):
111
+ def toRadians(self, **name):
101
112
  '''Convert this L{BetaOmega2Tuple} to L{Radians}.
102
113
 
103
- @return: L{BetaOmega2Tuple}C{(beta, omega)} with
104
- C{beta} and C{omega} both in L{Radians}.
114
+ @kwarg name: Optional C{B{name}=NN} (C{str}), overriding this name.
115
+
116
+ @return: L{BetaOmega2Tuple}C{(beta, omega)} with C{beta} and C{omega}
117
+ both in L{Radians}.
105
118
  '''
106
- return _NamedTupleTo._toRadians(self, *self)
119
+ return self._toRadians(name)
107
120
 
108
121
 
109
- class BetaOmega3Tuple(_NamedTupleTo):
122
+ class BetaOmega3Tuple(_NamedTupleToX):
110
123
  '''3-Tuple C{(beta, omega, height)} with I{ellipsoidal} lat- and
111
124
  longitude C{beta} and C{omega} both in L{Radians} (or L{Degrees})
112
125
  and the C{height}, rather the (signed) I{distance} to the triaxial's
@@ -116,54 +129,62 @@ class BetaOmega3Tuple(_NamedTupleTo):
116
129
  _Names_ = BetaOmega2Tuple._Names_ + (_height_,)
117
130
  _Units_ = BetaOmega2Tuple._Units_ + ( Meter,)
118
131
 
119
- def toDegrees(self, **toDMS_kwds):
132
+ def toDegrees(self, name=NN, **toDMS_kwds):
120
133
  '''Convert this L{BetaOmega3Tuple} to L{Degrees} or C{toDMS}.
121
134
 
135
+ @kwarg name: Optional name (C{str}), overriding this name.
136
+
122
137
  @return: L{BetaOmega3Tuple}C{(beta, omega, height)} with
123
- C{beta} and C{omega} both in L{Degrees} or as a
124
- L{toDMS} string provided some B{C{toDMS_kwds}}
138
+ C{beta} and C{omega} both in L{Degrees} or as
139
+ L{toDMS} strings provided some B{C{toDMS_kwds}}
125
140
  keyword arguments are specified.
126
141
  '''
127
- return _NamedTupleTo._toDegrees(self, *self, **toDMS_kwds)
142
+ return self._toDegrees(name, **toDMS_kwds)
128
143
 
129
- def toRadians(self):
144
+ def toRadians(self, **name):
130
145
  '''Convert this L{BetaOmega3Tuple} to L{Radians}.
131
146
 
132
- @return: L{BetaOmega3Tuple}C{(beta, omega, height)} with
133
- C{beta} and C{omega} both in L{Radians}.
147
+ @kwarg name: Optional C{B{name}=NN} (C{str}), overriding this name.
148
+
149
+ @return: L{BetaOmega3Tuple}C{(beta, omega, height)} with C{beta}
150
+ and C{omega} both in L{Radians}.
134
151
  '''
135
- return _NamedTupleTo._toRadians(self, *self)
152
+ return self._toRadians(name)
136
153
 
137
- def to2Tuple(self):
154
+ def to2Tuple(self, **name):
138
155
  '''Reduce this L{BetaOmega3Tuple} to a L{BetaOmega2Tuple}.
156
+
157
+ @kwarg name: Optional C{B{name}=NN} (C{str}), overriding this name.
139
158
  '''
140
- return BetaOmega2Tuple(*self[:2])
159
+ return BetaOmega2Tuple(*self[:2], name=self._name__(name))
141
160
 
142
161
 
143
- class Jacobi2Tuple(_NamedTupleTo):
162
+ class Jacobi2Tuple(_NamedTupleToX):
144
163
  '''2-Tuple C{(x, y)} with a Jacobi Conformal C{x} and C{y}
145
164
  projection, both in L{Radians} (or L{Degrees}).
146
165
  '''
147
166
  _Names_ = (_x_, _y_)
148
167
  _Units_ = (_Pass, _Pass)
149
168
 
150
- def toDegrees(self, **toDMS_kwds):
169
+ def toDegrees(self, name=NN, **toDMS_kwds):
151
170
  '''Convert this L{Jacobi2Tuple} to L{Degrees} or C{toDMS}.
152
171
 
153
- @return: L{Jacobi2Tuple}C{(x, y)} with C{x} and C{y}
154
- both in L{Degrees} or as a L{toDMS} string
155
- provided some B{C{toDMS_kwds}} keyword
156
- arguments are specified.
172
+ @kwarg name: Optional name (C{str}), overriding this name.
173
+
174
+ @return: L{Jacobi2Tuple}C{(x, y)} with C{x} and C{y} both
175
+ in L{Degrees} or as L{toDMS} strings provided some
176
+ B{C{toDMS_kwds}} keyword arguments are specified.
157
177
  '''
158
- return _NamedTupleTo._toDegrees(self, *self, **toDMS_kwds)
178
+ return self._toDegrees(name, **toDMS_kwds)
159
179
 
160
- def toRadians(self):
180
+ def toRadians(self, **name):
161
181
  '''Convert this L{Jacobi2Tuple} to L{Radians}.
162
182
 
163
- @return: L{Jacobi2Tuple}C{(x, y)} with C{x}
164
- and C{y} both in L{Radians}.
183
+ @kwarg name: Optional C{B{name}=NN} (C{str}), overriding this name.
184
+
185
+ @return: L{Jacobi2Tuple}C{(x, y)} with C{x} and C{y} both in L{Radians}.
165
186
  '''
166
- return _NamedTupleTo._toRadians(self, *self)
187
+ return self._toRadians(name)
167
188
 
168
189
 
169
190
  class Triaxial_(_NamedEnumItem):
@@ -192,8 +213,7 @@ class Triaxial_(_NamedEnumItem):
192
213
  C{meter}) or an other L{Triaxial} or L{Triaxial_} instance.
193
214
  @kwarg b: Middle, C{Y} semi-axis (C{meter}, same units as B{C{a}}), required
194
215
  if C{B{a_triaxial} is scalar}, ignored otherwise.
195
- @kwarg c: Small, C{Z} semi-axis (C{meter}, same units as B{C{a}}), required
196
- if C{B{a_triaxial} is scalar}, ignored otherwise.
216
+ @kwarg c: Small, C{Z} semi-axis (C{meter}, B{C{b}}).
197
217
  @kwarg name: Optional C{B{name}=NN} (C{str}).
198
218
 
199
219
  @raise TriaxialError: Invalid semi-axis or -axes.
@@ -360,13 +380,14 @@ class Triaxial_(_NamedEnumItem):
360
380
 
361
381
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian}, L{Ecef9Tuple},
362
382
  L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
363
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
364
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
383
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}, ignored
384
+ otherwise.
385
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
365
386
  @kwarg normal: If C{True} the projection is the I{normal, plumb} to the surface of,
366
387
  otherwise the C{radial} line to the center of this triaxial (C{bool}).
367
388
  @kwarg eps: Tolerance for root finding and validation (C{scalar}), use a negative
368
389
  value to skip validation.
369
- @kwarg name: Optional, overriding C{B{name}="heigh4"} (C{str}).
390
+ @kwarg name: Optional C{B{name}="heigh4"} (C{str}).
370
391
 
371
392
  @return: L{Vector4Tuple}C{(x, y, z, h)} with the cartesian coordinates C{x}, C{y}
372
393
  and C{z} of the projection on or the intersection with and with the height
@@ -391,7 +412,7 @@ class Triaxial_(_NamedEnumItem):
391
412
  x, y, z = v.xyz
392
413
  try:
393
414
  if normal: # plumb to surface
394
- x, y, z, h, i = _normalTo5(x, y, z, self, eps=eps)
415
+ x, y, z, h, i = _plumbTo5(x, y, z, self, eps=eps)
395
416
  else: # radial to center
396
417
  x, y, z = self._radialTo3(z, hypot(x, y), y, x)
397
418
  h = v.minus_(x, y, z).length
@@ -399,8 +420,8 @@ class Triaxial_(_NamedEnumItem):
399
420
  raise TriaxialError(x=x, y=y, z=z, cause=e)
400
421
  if h > 0 and self.sideOf(v, eps=EPS0) < 0:
401
422
  h = -h # below the surface
402
- return Vector4Tuple(x, y, z, h, iteration=i,
403
- name=_name__(name, name__=self.height4))
423
+ n = _name__(name, name__=self.height4)
424
+ return Vector4Tuple(x, y, z, h, iteration=i, name=n)
404
425
 
405
426
  @Property_RO
406
427
  def isOrdered(self):
@@ -430,8 +451,9 @@ class Triaxial_(_NamedEnumItem):
430
451
 
431
452
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
432
453
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
433
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
434
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
454
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}, ignored
455
+ otherwise.
456
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
435
457
  @kwarg length: Optional length and in-/outward direction (C{scalar}).
436
458
 
437
459
  @return: A C{Vector3d(x_, y_, z_)} normalized to B{C{length}}, pointing
@@ -478,7 +500,7 @@ class Triaxial_(_NamedEnumItem):
478
500
 
479
501
  @Property_RO
480
502
  def _ordered4(self):
481
- '''(INTERNAL) Helper for C{_hartzell3} and C{_normalTo5}.
503
+ '''(INTERNAL) Helper for C{_hartzell3} and C{_plumbTo5}.
482
504
  '''
483
505
  def _order2(reverse, a, b, c):
484
506
  '''(INTERNAL) Un-Order C{a}, C{b} and C{c}.
@@ -537,8 +559,9 @@ class Triaxial_(_NamedEnumItem):
537
559
 
538
560
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
539
561
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
540
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
541
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
562
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar},
563
+ ignored otherwise.
564
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
542
565
  @kwarg eps: Near-surface tolerance (C{scalar}, distance I{squared}).
543
566
 
544
567
  @return: C{INT0} if C{(B{x}, B{y}, B{z})} is near this triaxial's surface
@@ -572,7 +595,7 @@ class Triaxial_(_NamedEnumItem):
572
595
  raise TriaxialError(a=a, b=b, c=c, txt=t)
573
596
  return Ellipsoid(a, b=b, name=self._name__(name))
574
597
 
575
- def toStr(self, prec=9, name=NN, **unused): # PYCHOK signature
598
+ def toStr(self, prec=9, **name): # PYCHOK signature
576
599
  '''Return this C{Triaxial} as a string.
577
600
 
578
601
  @kwarg prec: Precision, number of decimal digits (0..9).
@@ -590,7 +613,7 @@ class Triaxial_(_NamedEnumItem):
590
613
  if isinstance(self, J):
591
614
  t += J.xyQ2,
592
615
  t += T.volume, T.area
593
- return self._instr(name, prec, props=t, area_p=self.area_p()) # __name__
616
+ return self._instr(area_p=self.area_p(), prec=prec, props=t, **name)
594
617
 
595
618
  @Property_RO
596
619
  def volume(self):
@@ -614,14 +637,13 @@ class Triaxial(Triaxial_):
614
637
  or an other L{Triaxial} or L{Triaxial_} instance.
615
638
  @kwarg b: Middle semi-axis (C{meter}, same units as B{C{a}}), required
616
639
  if C{B{a_triaxial} is scalar}, ignored otherwise.
617
- @kwarg c: Smallest semi-axis (C{meter}, same units as B{C{a}}), required
618
- if C{B{a_triaxial} is scalar}, ignored otherwise.
640
+ @kwarg c: Smallest semi-axis (C{meter}, like B{C{b}}).
619
641
  @kwarg name: Optional C{B{name}=NN} (C{str}).
620
642
 
621
643
  @note: The semi-axes must be ordered as C{B{a} >= B{b} >= B{c} > 0} and
622
644
  must be ellipsoidal, C{B{a} > B{c}}.
623
645
 
624
- @raise TriaxialError: Semi-axes not ordered, spherical or invalid.
646
+ @raise TriaxialError: Semi-axes unordered, spherical or invalid.
625
647
  '''
626
648
  Triaxial_.__init__(self, a_triaxial, b=b, c=c, **name)
627
649
 
@@ -719,8 +741,9 @@ class Triaxial(Triaxial_):
719
741
 
720
742
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
721
743
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
722
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
723
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
744
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar},
745
+ ignored otherwise.
746
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
724
747
  @kwarg normal_eps_name: Optional keyword arguments C{B{normal}=True},
725
748
  C{B{eps}=EPS} and overriding C{B{name}="height4"} (C{str}),
726
749
  see method L{Triaxial.height4}.
@@ -824,8 +847,9 @@ class Triaxial(Triaxial_):
824
847
 
825
848
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
826
849
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
827
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
828
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
850
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar},
851
+ ignored otherwise.
852
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
829
853
  @kwarg name: Optional C{B{name}=NN} (C{str}).
830
854
 
831
855
  @return: A L{BetaOmega3Tuple}C{(beta, omega, height)} with C{beta} and
@@ -845,8 +869,9 @@ class Triaxial(Triaxial_):
845
869
 
846
870
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
847
871
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
848
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
849
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
872
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar},
873
+ ignored otherwise.
874
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
850
875
  @arg h: Height above or below this triaxial's surface (C{meter}, same units
851
876
  as the axes).
852
877
  @kwarg normal: If C{True} the height is C{normal} to the surface, otherwise
@@ -878,8 +903,9 @@ class Triaxial(Triaxial_):
878
903
 
879
904
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
880
905
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
881
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
882
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
906
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar},
907
+ ignored otherwise.
908
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
883
909
  @kwarg name: Optional C{B{name}=NN} (C{str}).
884
910
 
885
911
  @return: A L{LatLon3Tuple}C{(lat, lon, height)} with C{lat} and C{lon}
@@ -894,8 +920,8 @@ class Triaxial(Triaxial_):
894
920
  s = v.times_(self._1e2ac, # == 1 - e_sub_x**2
895
921
  self._1e2bc, # == 1 - e_sub_y**2
896
922
  _1_0)
897
- t = self._reverseLatLon3(s, atan2d, v, self.forwardLatLon_)
898
- return LatLon3Tuple(*t, **name)
923
+ a, b, h = self._reverseLatLon3(s, atan2d, v, self.forwardLatLon_)
924
+ return LatLon3Tuple(Degrees(lat=a), Degrees(lon=b), h, **name)
899
925
 
900
926
  def _reverseLatLon3(self, s, atan2_, v, forward_):
901
927
  '''(INTERNAL) Helper for C{.reverseBetOmg} and C{.reverseLatLon}.
@@ -1171,7 +1197,7 @@ def _hartzell3(pov, los, Tun): # in .Ellipsoid.hartzell4, .formy.hartzell
1171
1197
 
1172
1198
  p3 = _otherV3d(pov=pov.toCartesian() if isLatLon(pov) else pov)
1173
1199
  if los is True: # normal
1174
- a, b, c, d, i = _normalTo5(p3.x, p3.y, p3.z, Tun)
1200
+ a, b, c, d, i = _plumbTo5(p3.x, p3.y, p3.z, Tun)
1175
1201
  return type(p3)(a, b, c), d, i
1176
1202
 
1177
1203
  u3 = p3.negate() if los is False or los is None else _toUvwV3d(los, pov)
@@ -1265,15 +1291,22 @@ def _hypot21(x, y, z=0):
1265
1291
  return fsumf_(_1_0, x**2, y**2, (z**2 if z else _0_0), _N_2_0)
1266
1292
 
1267
1293
 
1268
- def _normalTo4(x, y, a, b, eps=EPS):
1294
+ def _otherV3d_(x_xyz, y, z, **name):
1295
+ '''(INTERNAL) Get a Vector3d from C{x_xyz}, C{y} and C{z}.
1296
+ '''
1297
+ return Vector3d(x_xyz, y, z, **name) if isscalar(x_xyz) else \
1298
+ _otherV3d(x_xyz=x_xyz, **name)
1299
+
1300
+
1301
+ def _plumbTo4(x, y, a, b, eps=EPS):
1269
1302
  '''(INTERNAL) Nearest point on and distance to a 2-D ellipse, I{unordered}.
1270
1303
 
1271
- @see: Function C{pygeodesy.ellipsoids._normalTo3} and I{Eberly}'s U{Distance
1304
+ @see: Function C{pygeodesy.ellipsoids._plumbTo3} and I{Eberly}'s U{Distance
1272
1305
  from a Point to ... an Ellipse ...<https://www.GeometricTools.com/
1273
1306
  Documentation/DistancePointEllipseEllipsoid.pdf>}.
1274
1307
  '''
1275
1308
  if b > a:
1276
- b, a, d, i = _normalTo4(y, x, b, a, eps=eps)
1309
+ b, a, d, i = _plumbTo4(y, x, b, a, eps=eps)
1277
1310
  return a, b, d, i
1278
1311
 
1279
1312
  if not (b > 0 and isfinite(a)):
@@ -1318,7 +1351,7 @@ def _normalTo4(x, y, a, b, eps=EPS):
1318
1351
  return a, b, d, i
1319
1352
 
1320
1353
 
1321
- def _normalTo5(x, y, z, Tun, eps=EPS): # MCCABE 19
1354
+ def _plumbTo5(x, y, z, Tun, eps=EPS): # MCCABE 19 in .testTriaxials
1322
1355
  '''(INTERNAL) Nearest point on and distance to an I{un-/ordered} triaxial.
1323
1356
 
1324
1357
  @see: I{Eberly}'s U{Distance from a Point to ... an Ellipsoid ...<https://
@@ -1327,7 +1360,7 @@ def _normalTo5(x, y, z, Tun, eps=EPS): # MCCABE 19
1327
1360
  a, b, c, T = Tun._ordered4
1328
1361
  if Tun is not T: # T is ordered, Tun isn't
1329
1362
  t = T._order3(x, y, z) + (T,)
1330
- a, b, c, d, i = _normalTo5(*t, eps=eps)
1363
+ a, b, c, d, i = _plumbTo5(*t, eps=eps)
1331
1364
  return T._order3(a, b, c, reverse=True) + (d, i)
1332
1365
 
1333
1366
  if not (c > 0 and isfinite(a)):
@@ -1358,10 +1391,10 @@ def _normalTo5(x, y, z, Tun, eps=EPS): # MCCABE 19
1358
1391
  d = hypot_(x - a, y - b, z - c)
1359
1392
  else: # x == 0
1360
1393
  a = x # 0
1361
- b, c, d, i = _normalTo4(y, z, b, c, eps=eps)
1394
+ b, c, d, i = _plumbTo4(y, z, b, c, eps=eps)
1362
1395
  elif x: # y == 0
1363
1396
  b = y # 0
1364
- a, c, d, i = _normalTo4(x, z, a, c, eps=eps)
1397
+ a, c, d, i = _plumbTo4(x, z, a, c, eps=eps)
1365
1398
  else: # x == y == 0
1366
1399
  if z < 0:
1367
1400
  c = -c
@@ -1386,7 +1419,7 @@ def _normalTo5(x, y, z, Tun, eps=EPS): # MCCABE 19
1386
1419
  t = False
1387
1420
  if t:
1388
1421
  c = z # signed-0
1389
- a, b, d, i = _normalTo4(x, y, a, b, eps=eps)
1422
+ a, b, d, i = _plumbTo4(x, y, a, b, eps=eps)
1390
1423
 
1391
1424
  if val > 0: # validate
1392
1425
  e = T.sideOf(a, b, c, eps=val)
@@ -1405,13 +1438,6 @@ def _normalTo5(x, y, z, Tun, eps=EPS): # MCCABE 19
1405
1438
  return a, b, c, d, i
1406
1439
 
1407
1440
 
1408
- def _otherV3d_(x_xyz, y, z, **name):
1409
- '''(INTERNAL) Get a Vector3d from C{x_xyz}, C{y} and C{z}.
1410
- '''
1411
- return Vector3d(x_xyz, y, z, **name) if isscalar(x_xyz) else \
1412
- _otherV3d(x_xyz=x_xyz)
1413
-
1414
-
1415
1441
  def _rootXd(r, s, u, v, w, g, eps):
1416
1442
  '''(INTERNAL) Robust 2d- or 3d-root finder: 2d- if C{s == v == 0} else 3d-root.
1417
1443