1

2# -*- coding: utf-8 -*-

3

4 u'''Wrapper to invoke I{Karney}'s U{GeodSolve

5<https://GeographicLib.SourceForge.io/C++/doc/GeodSolve.1.html>} utility

6 as an (exact) geodesic, but intended I{for testing purposes only}.

7

8 Set env variable C{PYGEODESY_GEODSOLVE} to the (fully qualified) path

9 of the C{GeodSolve} executable.

10'''

11

12 from pygeodesy.basics import _xinstanceof

13# from pygeodesy.constants import NAN, _0_0 # from .karney

14# from pygeodesy.geodesicx import GeodesicAreaExact # _MODS

15 from pygeodesy.interns import NN, _UNDER_

16 from pygeodesy.karney import Caps, GeodesicError, GeodSolve12Tuple, \

17 _sincos2d, _0_0, NAN

18 from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS, \

19 _getenv, _PYGEODESY_GEODSOLVE_

20 from pygeodesy.named import _name1__

21 from pygeodesy.namedTuples import Destination3Tuple, Distance3Tuple

22 from pygeodesy.props import Property, Property_RO, property_RO

23 from pygeodesy.solveBase import _SolveGDictBase, _SolveGDictLineBase

24 from pygeodesy.utily import _unrollon, _Wrap, wrap360

25

26__all__ = _ALL_LAZY.geodsolve

27__version__ = '24.08.13'

28

29

30 class _GeodesicSolveBase(_SolveGDictBase):

31 '''(INTERNAL) Base class for L{GeodesicSolve} and L{GeodesicLineSolve}.

32 '''

33 _Error = GeodesicError

34 _Names_Direct = \

35 _Names_Inverse = GeodSolve12Tuple._Names_

36 _Xable_name = 'GeodSolve'

37 _Xable_path = _getenv(_PYGEODESY_GEODSOLVE_, _PYGEODESY_GEODSOLVE_)

38

39 @Property_RO

40 def _b_option(self):

41 return ('-b',) if self.reverse2 else ()

42

43 @Property_RO

44 def _cmdBasic(self):

45 '''(INTERNAL) Get the basic C{GeodSolve} cmd (C{tuple}).

46 '''

47 return (self.GeodSolve, '-f') + (self._b_option +

48 self._e_option +

49 self._E_option +

50 self._p_option +

51 self._u_option)

52

53 @Property

54 def GeodSolve(self):

55 '''Get the U{GeodSolve<https://GeographicLib.SourceForge.io/C++/doc/GeodSolve.1.html>}

56 executable (C{filename}).

57 '''

58 return self._Xable_path

59

60 @GeodSolve.setter # PYCHOK setter!

61 def GeodSolve(self, path):

62 '''Set the U{GeodSolve<https://GeographicLib.SourceForge.io/C++/doc/GeodSolve.1.html>}

63 executable (C{filename}), the (fully qualified) path to the C{GeodSolve} executable.

64

65 @raise GeodesicError: Invalid B{C{path}}, B{C{path}} doesn't exist or

66 isn't the C{GeodSolve} executable.

67 '''

68 self._setXable(path)

69

70 def toStr(self, **prec_sep): # PYCHOK signature

71 '''Return this C{GeodesicSolve} as string.

72

73 @kwarg prec_sep: Keyword argumens C{B{prec}=6} and C{B{sep}=", "}

74 for the C{float} C{prec}ision, number of decimal digits

75 (0..9) and the C{sep}arator string to join. Trailing

76 zero decimals are stripped for B{C{prec}} values of 1

77 and above, but kept for negative B{C{prec}} values.

78

79 @return: GeodesicSolve items (C{str}).

80 '''

81 return _SolveGDictBase._toStr(self, GeodSolve=self.GeodSolve, **prec_sep)

82

83 @Property_RO

84 def _u_option(self):

85 return ('-u',) if self.unroll else ()

86

87

88 class GeodesicSolve(_GeodesicSolveBase):

89 '''Wrapper to invoke I{Karney}'s U{GeodSolve<https://GeographicLib.SourceForge.io/C++/doc/GeodSolve.1.html>}

90 as an C{Exact} version of I{Karney}'s Python class U{Geodesic<https://GeographicLib.SourceForge.io/C++/doc/

91 python/code.html#geographiclib.geodesic.Geodesic>}.

92

93 @note: Use property C{GeodSolve} or env variable C{PYGEODESY_GEODSOLVE} to specify the (fully

94 qualified) path to the C{GeodSolve} executable.

95

96 @note: This C{geodesic} is intended I{for testing purposes only}, it invokes the C{GeodSolve}

97 executable for I{every} method call.

98 '''

99

100 def Area(self, polyline=False, **name):

101 '''Set up a L{GeodesicAreaExact} to compute area and perimeter

102 of a polygon.

103

104 @kwarg polyline: If C{True}, compute the perimeter only, otherwise

105 perimeter and area (C{bool}).

106 @kwarg name: Optional C{B{name}=NN} (C{str}).

107

108 @return: A L{GeodesicAreaExact} instance.

109

110 @note: The B{C{debug}} setting is passed as C{verbose}

111 to the returned L{GeodesicAreaExact} instance.

112 '''

113 gaX = _MODS.geodesicx.GeodesicAreaExact(self, polyline=polyline, **name)

114 if self.verbose or self.debug: # PYCHOK no cover

115 gaX.verbose = True

116 return gaX

117

118 Polygon = Area # for C{geographiclib} compatibility

119

120 def Direct3(self, lat1, lon1, azi1, s12): # PYCHOK outmask

121 '''Return the destination lat, lon and reverse azimuth (final bearing)

122 in C{degrees}.

123

124 @return: L{Destination3Tuple}C{(lat, lon, final)}.

125 '''

126 r = self._GDictDirect(lat1, lon1, azi1, False, s12, floats=False)

127 return Destination3Tuple(float(r.lat2), float(r.lon2), wrap360(r.azi2),

128 iteration=r._iteration)

129

130 def _DirectLine(self, ll1, azi12, **caps_name): # PYCHOK no cover

131 '''(INTERNAL) Short-cut version.

132 '''

133 return self.DirectLine(ll1.lat, ll1.lon, azi12, **caps_name)

134

135 def DirectLine(self, lat1, lon1, azi1, **caps_name):

136 '''Set up a L{GeodesicLineSolve} to compute several points

137 on a single geodesic.

138

139 @arg lat1: Latitude of the first point (C{degrees}).

140 @arg lon1: Longitude of the first point (C{degrees}).

141 @arg azi1: Azimuth at the first point (compass C{degrees}).

142 @kwarg caps_name: Optional C{B{name}=NN} (C{str}) and keyword

143 argument C{B{caps}=Caps.ALL}, bit-or'ed combination

144 of L{Caps} values specifying the capabilities the

145 L{GeodesicLineSolve} instance should possess.

146

147 @return: A L{GeodesicLineSolve} instance.

148

149 @note: If the point is at a pole, the azimuth is defined by keeping

150 B{C{lon1}} fixed, writing C{B{lat1} = ±(90 − ε)}, and taking

151 the limit C{ε → 0+}.

152

153 @see: C++ U{GeodesicExact.Line

154 <https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1GeodesicExact.html>}

155 and Python U{Geodesic.Line<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.

156 '''

157 return GeodesicLineSolve(self, lat1, lon1, azi1, **_name1__(caps_name, _or_nameof=self))

158

159 Line = DirectLine

160

161 def _Inverse(self, ll1, ll2, wrap, **outmask): # PYCHOK no cover

162 '''(INTERNAL) Short-cut version, see .ellipsoidalBaseDI.intersecant2.

163 '''

164 if wrap:

165 ll2 = _unrollon(ll1, _Wrap.point(ll2))

166 return self.Inverse(ll1.lat, ll1.lon, ll2.lat, ll2.lon, **outmask)

167

168 def Inverse3(self, lat1, lon1, lat2, lon2): # PYCHOK outmask

169 '''Return the distance in C{meter} and the forward and

170 reverse azimuths (initial and final bearing) in C{degrees}.

171

172 @return: L{Distance3Tuple}C{(distance, initial, final)}.

173 '''

174 r = self._GDictInverse(lat1, lon1, lat2, lon2, floats=False)

175 return Distance3Tuple(float(r.s12), wrap360(r.azi1), wrap360(r.azi2),

176 iteration=r._iteration)

177

178 def _InverseLine(self, ll1, ll2, wrap, **caps_name): # PYCHOK no cover

179 '''(INTERNAL) Short-cut version.

180 '''

181 if wrap:

182 ll2 = _unrollon(ll1, _Wrap.point(ll2))

183 return self.InverseLine(ll1.lat, ll1.lon, ll2.lat, ll2.lon, **caps_name)

184

185# def _InverseLine2(self, lat1, lon1, lat2, lon2, **caps_name): # in .geodesici

186# '''(INTERNAL) Helper for L{InverseLine} and L{_InverseLine}.

187# '''

188# r = self.Inverse(lat1, lon1, lat2, lon2)

189# gl = GeodesicLineSolve(self, lat1, lon1, r.azi1, **_name1__(caps_name, _or_nameof=self))

190# gl._a13 = r.a12 # gl.SetArc(r.a12)

191# gl._s13 = r.s12 # gl.SetDistance(r.s12)

192# return gl, r

193

194 def InverseLine(self, lat1, lon1, lat2, lon2, **caps_name): # PYCHOK no cover

195 '''Set up a L{GeodesicLineSolve} to compute several points

196 on a single geodesic.

197

198 @arg lat1: Latitude of the first point (C{degrees}).

199 @arg lon1: Longitude of the first point (C{degrees}).

200 @arg lat2: Latitude of the second point (C{degrees}).

201 @arg lon2: Longitude of the second point (C{degrees}).

202 @kwarg caps_name: Optional C{B{name}=NN} (C{str}) and keyword

203 argument C{B{caps}=Caps.ALL}, bit-or'ed combination

204 of L{Caps} values specifying the capabilities the

205 L{GeodesicLineSolve} instance should possess.

206

207 @return: A L{GeodesicLineSolve} instance.

208

209 @note: Both B{C{lat1}} and B{C{lat2}} should in the range C{[-90, +90]}.

210

211 @see: C++ U{GeodesicExact.InverseLine

212 <https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1GeodesicExact.html>} and

213 Python U{Geodesic.InverseLine<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.

214 '''

215 r = self.Inverse(lat1, lon1, lat2, lon2)

216 gl = GeodesicLineSolve(self, lat1, lon1, r.azi1, **_name1__(caps_name, _or_nameof=self))

217 gl._a13 = r.a12 # gl.SetArc(r.a12)

218 gl._s13 = r.s12 # gl.SetDistance(r.s12)

219 return gl

220

221

222 class GeodesicLineSolve(_GeodesicSolveBase, _SolveGDictLineBase):

223 '''Wrapper to invoke I{Karney}'s U{GeodSolve<https://GeographicLib.SourceForge.io/C++/doc/GeodSolve.1.html>}

224 as an C{Exact} version of I{Karney}'s Python class U{GeodesicLine<https://GeographicLib.SourceForge.io/C++/doc/

225 python/code.html#geographiclib.geodesicline.GeodesicLine>}.

226

227 @note: Use property C{GeodSolve} or env variable C{PYGEODESY_GEODSOLVE} to specify the (fully

228 qualified) path to the C{GeodSolve} executable.

229

230 @note: This C{geodesic} is intended I{for testing purposes only}, it invokes the C{GeodSolve}

231 executable for I{every} method call.

232 '''

233 _a13 = \

234 _s13 = NAN # see GeodesicSolve._InverseLine

235

236 def __init__(self, geodesic, lat1, lon1, azi1, caps=Caps.ALL, **name):

237 '''New L{GeodesicLineSolve} instance, allowing points to be found along

238 a geodesic starting at C{(B{lat1}, B{lon1})} with azimuth B{C{azi1}}.

239

240 @arg geodesic: The geodesic to use (L{GeodesicSolve}).

241 @arg lat1: Latitude of the first point (C{degrees}).

242 @arg lon1: Longitude of the first point (C{degrees}).

243 @arg azi1: Azimuth at the first points (compass C{degrees}).

244 @kwarg caps: Bit-or'ed combination of L{Caps} values specifying the

245 capabilities the L{GeodesicLineSolve} instance should possess,

246 C{B{caps}=Caps.ALL} always. Include C{Caps.LINE_OFF} if

247 updates to the B{C{geodesic}} should I{not} be reflected in

248 this L{GeodesicLineSolve} instance.

249 @kwarg name: Optional C{B{name}=NN} (C{str}).

250

251 @raise GeodesicError: Invalid path for the C{GeodSolve} executable

252 or isn't the C{GeodSolve} executable, see

253 property C{geodesic.GeodSolve}.

254

255 @raise TypeError: Invalid B{C{geodesic}}.

256 '''

257 _xinstanceof(GeodesicSolve, geodesic=geodesic)

258 if (caps & Caps.LINE_OFF): # copy to avoid updates

259 geodesic = geodesic.copy(deep=False, name=_UNDER_(NN, geodesic.name)) # NOT _under!

260 _SolveGDictLineBase.__init__(self, geodesic, lat1, lon1, caps, azi1=azi1, **name)

261 try:

262 self.GeodSolve = geodesic.GeodSolve # geodesic or copy of geodesic

263 except GeodesicError:

264 pass

265

266 @Property_RO

267 def a13(self):

268 '''Get the arc length to reference point 3 (C{degrees}).

269

270 @see: Methods L{Arc} and L{SetArc}.

271 '''

272 return self._a13

273

274 def Arc(self):

275 '''Return the arc length to reference point 3 (C{degrees} or C{NAN}).

276

277 @see: Method L{SetArc} and property L{a13}.

278 '''

279 return self.a13

280

281 def ArcPosition(self, a12, outmask=Caps.STANDARD): # PYCHOK unused

282 '''Find the position on the line given B{C{a12}}.

283

284 @arg a12: Spherical arc length from the first point to the

285 second point (C{degrees}).

286

287 @return: A C{GDict} with 12 items C{lat1, lon1, azi1, lat2, lon2,

288 azi2, m12, a12, s12, M12, M21, S12}.

289 '''

290 return self._GDictInvoke(self._cmdArc, self._Names_Direct, a12)._unCaps(outmask)

291

292 @Property_RO

293 def azi1(self):

294 '''Get the azimuth at the first point (compass C{degrees}).

295 '''

296 return self._lla1.azi1

297

298 azi12 = azi1 # like RhumbLineSolve

299

300 @Property_RO

301 def azi1_sincos2(self):

302 '''Get the sine and cosine of the first point's azimuth (2-tuple C{(sin, cos)}).

303 '''

304 return _sincos2d(self.azi1)

305

306 azi12_sincos2 = azi1_sincos2

307

308 @Property_RO

309 def _cmdArc(self):

310 '''(INTERNAL) Get the C{GeodSolve} I{-a -L} cmd (C{tuple}).

311 '''

312 return self._cmdDistance + ('-a',)

313

314 def Distance(self):

315 '''Return the distance to reference point 3 (C{meter} or C{NAN}).

316 '''

317 return self.s13

318

319 @property_RO

320 def geodesic(self):

321 '''Get the geodesic (L{GeodesicSolve}).

322 '''

323 return self._solve # see .solveBase._SolveLineBase

324

325 def Intersecant2(self, lat0, lon0, radius, **kwds): # PYCHOK no cover

326 '''B{Not implemented}, throws a C{NotImplementedError} always.'''

327 self._notImplemented(lat0, lon0, radius, **kwds)

328

329 def PlumbTo(self, lat0, lon0, **kwds): # PYCHOK no cover

330 '''B{Not implemented}, throws a C{NotImplementedError} always.'''

331 self._notImplemented(lat0, lon0, **kwds)

332

333 def Position(self, s12, outmask=Caps.STANDARD):

334 '''Find the position on the line given B{C{s12}}.

335

336 @arg s12: Distance from the first point to the second (C{meter}).

337

338 @return: A C{GDict} with 12 items C{lat1, lon1, azi1, lat2, lon2,

339 azi2, m12, a12, s12, M12, M21, S12}, possibly C{a12=NAN}.

340 '''

341 return self._GDictInvoke(self._cmdDistance, self._Names_Direct, s12)._unCaps(outmask)

342

343 @Property_RO

344 def s13(self):

345 '''Get the distance to reference point 3 (C{meter} or C{NAN}).

346

347 @see: Methods L{Distance} and L{SetDistance}.

348 '''

349 return self._s13

350

351 def SetArc(self, a13):

352 '''Set reference point 3 in terms relative to the first point.

353

354 @arg a13: Spherical arc length from the first to the reference

355 point (C{degrees}).

356

357 @return: The distance C{s13} (C{meter}) between the first and

358 the reference point or C{NAN}.

359 '''

360 if self._a13 != a13:

361 self._a13 = a13

362 self._s13 = self.ArcPosition(a13, outmask=Caps.DISTANCE).s12 # if a13 else _0_0

363# _update_all(self)

364 return self._s13

365

366 def SetDistance(self, s13):

367 '''Set reference point 3 in terms relative to the first point.

368

369 @arg s13: Distance from the first to the reference point (C{meter}).

370

371 @return: The arc length C{a13} (C{degrees}) between the first

372 and the reference point or C{NAN}.

373 '''

374 if self._s13 != s13:

375 self._s13 = s13

376 self._a13 = self.Position(s13, outmask=Caps.DISTANCE).a12 if s13 else _0_0

377# _update_all(self)

378 return self._a13 # NAN for GeodesicLineExact without Cap.DISTANCE_IN

379

380 def toStr(self, **prec_sep): # PYCHOK signature

381 '''Return this C{GeodesicLineSolve} as string.

382

383 @kwarg prec_sep: Keyword argumens C{B{prec}=6} and C{B{sep}=", "}

384 for the C{float} C{prec}ision, number of decimal digits

385 (0..9) and the C{sep}arator string to join. Trailing

386 zero decimals are stripped for B{C{prec}} values of 1

387 and above, but kept for negative B{C{prec}} values.

388

389 @return: GeodesicLineSolve items (C{str}).

390 '''

391 return _SolveGDictLineBase._toStr(self, azi1=self.azi1, geodesic=self._solve,

392 GeodSolve=self.GeodSolve, **prec_sep)

393

394

395__all__ += _ALL_DOCS(_GeodesicSolveBase)

396

397 if __name__ == '__main__':

398

399 from pygeodesy import printf

400 from sys import argv

401

402 gS = GeodesicSolve(name='Test')

403 gS.verbose = '--verbose' in argv # or '-v' in argv

404

405 if gS.GeodSolve in (_PYGEODESY_GEODSOLVE_, None): # not set

406 gS.GeodSolve = '/opt/local/bin/GeodSolve' # '/opt/local/Cellar/geographiclib/2.3/bin/GeodSolve' # HomeBrew

407 printf('version: %s', gS.version)

408

409 r = gS.Direct(40.6, -73.8, 51, 5.5e6)

410 printf('Direct: %r', r, nl=1)

411 printf('Direct3: %r', gS.Direct3(40.6, -73.8, 51, 5.5e6))

412

413 printf('Inverse: %r', gS.Inverse( 40.6, -73.8, 51.6, -0.5), nl=1)

414 printf('Inverse1: %r', gS.Inverse1(40.6, -73.8, 51.6, -0.5))

415 printf('Inverse3: %r', gS.Inverse3(40.6, -73.8, 51.6, -0.5))

416

417 glS = GeodesicLineSolve(gS, 40.6, -73.8, 51, name='LineTest')

418 p = glS.Position(5.5e6)

419 printf('Position: %s %r', p == r, p, nl=1)

420 p = glS.ArcPosition(49.475527)

421 printf('ArcPosition: %s %r', p == r, p)

422

423

424# % python3 -m pygeodesy.geodsolve

425

426# version: /opt/local/bin/GeodSolve: GeographicLib version 2.2

427

428# Direct: GDict(a12=49.475527, azi1=51.0, azi2=107.189397, lat1=40.6, lat2=51.884565, lon1=-73.8, lon2=-1.141173, m12=4844148.703101, M12=0.650911, M21=0.651229, s12=5500000.0, S12=39735075134877.09375)

429# Direct3: Destination3Tuple(lat=51.884565, lon=-1.141173, final=107.189397)

430

431# Inverse: GDict(a12=49.94131, azi1=51.198883, azi2=107.821777, lat1=40.6, lat2=51.6, lon1=-73.8, lon2=-0.5, m12=4877684.602706, M12=0.64473, M21=0.645046, s12=5551759.400319, S12=40041368848742.53125)

432# Inverse1: 49.94131021789904

433# Inverse3: Distance3Tuple(distance=5551759.400319, initial=51.198883, final=107.821777)

434

435# Position: True GDict(a12=49.475527, azi1=51.0, azi2=107.189397, lat1=40.6, lat2=51.884565, lon1=-73.8, lon2=-1.141173, m12=4844148.703101, M12=0.650911, M21=0.651229, s12=5500000.0, S12=39735075134877.09375)

436# ArcPosition: False GDict(a12=49.475527, azi1=51.0, azi2=107.189397, lat1=40.6, lat2=51.884565, lon1=-73.8, lon2=-1.141174, m12=4844148.669561, M12=0.650911, M21=0.651229, s12=5499999.948497, S12=39735074737272.734375)

437

438

439# % python3 -m pygeodesy.geodsolve --verbose

440

441# GeodesicSolve 'Test' 1: /opt/local/bin/GeodSolve --version (invoke)

442# GeodesicSolve 'Test' 1: /opt/local/bin/GeodSolve: GeographicLib version 2.2 (0)

443# version: /opt/local/bin/GeodSolve: GeographicLib version 2.2

444# GeodesicSolve 'Test' 2: /opt/local/bin/GeodSolve -f -E -p 10 \ 40.600000000000001 -73.799999999999997 51.0 5500000.0 (Direct)

445# GeodesicSolve 'Test' 2: lat1=40.600000000000001, lon1=-73.799999999999997, azi1=51.0, lat2=51.884564505606761, lon2=-1.141172861200829, azi2=107.189397162605886, s12=5500000.0, a12=49.475527463251467, m12=4844148.703101486, M12=0.65091056699808603, M21=0.65122865892196558, S12=39735075134877.094 (0)

446

447# Direct: GDict(a12=49.475527, azi1=51.0, azi2=107.189397, lat1=40.6, lat2=51.884565, lon1=-73.8, lon2=-1.141173, m12=4844148.703101, M12=0.650911, M21=0.651229, s12=5500000.0, S12=39735075134877.09375)

448# GeodesicSolve 'Test' 3: /opt/local/bin/GeodSolve -f -E -p 10 \ 40.600000000000001 -73.799999999999997 51.0 5500000.0 (Direct3)

449# GeodesicSolve 'Test' 3: lat1=40.600000000000001, lon1=-73.799999999999997, azi1=51.0, lat2=51.884564505606761, lon2=-1.141172861200829, azi2=107.189397162605886, s12=5500000.0, a12=49.475527463251467, m12=4844148.703101486, M12=0.65091056699808603, M21=0.65122865892196558, S12=39735075134877.094 (0)

450# Direct3: Destination3Tuple(lat=51.884565, lon=-1.141173, final=107.189397)

451# GeodesicSolve 'Test' 4: /opt/local/bin/GeodSolve -f -E -p 10 -i \ 40.600000000000001 -73.799999999999997 51.600000000000001 -0.5 (Inverse)

452# GeodesicSolve 'Test' 4: lat1=40.600000000000001, lon1=-73.799999999999997, azi1=51.198882845579824, lat2=51.600000000000001, lon2=-0.5, azi2=107.821776735514248, s12=5551759.4003186841, a12=49.941310217899037, m12=4877684.6027061976, M12=0.64472969205948238, M21=0.64504567852134398, S12=40041368848742.531 (0)

453

454# Inverse: GDict(a12=49.94131, azi1=51.198883, azi2=107.821777, lat1=40.6, lat2=51.6, lon1=-73.8, lon2=-0.5, m12=4877684.602706, M12=0.64473, M21=0.645046, s12=5551759.400319, S12=40041368848742.53125)

455# GeodesicSolve 'Test' 5: /opt/local/bin/GeodSolve -f -E -p 10 -i \ 40.600000000000001 -73.799999999999997 51.600000000000001 -0.5 (Inverse1)

456# GeodesicSolve 'Test' 5: lat1=40.600000000000001, lon1=-73.799999999999997, azi1=51.198882845579824, lat2=51.600000000000001, lon2=-0.5, azi2=107.821776735514248, s12=5551759.4003186841, a12=49.941310217899037, m12=4877684.6027061976, M12=0.64472969205948238, M21=0.64504567852134398, S12=40041368848742.531 (0)

457# Inverse1: 49.94131021789904

458# GeodesicSolve 'Test' 6: /opt/local/bin/GeodSolve -f -E -p 10 -i \ 40.600000000000001 -73.799999999999997 51.600000000000001 -0.5 (Inverse3)

459# GeodesicSolve 'Test' 6: lat1=40.600000000000001, lon1=-73.799999999999997, azi1=51.198882845579824, lat2=51.600000000000001, lon2=-0.5, azi2=107.821776735514248, s12=5551759.4003186841, a12=49.941310217899037, m12=4877684.6027061976, M12=0.64472969205948238, M21=0.64504567852134398, S12=40041368848742.531 (0)

460# Inverse3: Distance3Tuple(distance=5551759.400319, initial=51.198883, final=107.821777)

461

462# Position: True GDict(a12=49.475527, azi1=51.0, azi2=107.189397, lat1=40.6, lat2=51.884565, lon1=-73.8, lon2=-1.141173, m12=4844148.703101, M12=0.650911, M21=0.651229, s12=5500000.0, S12=39735075134877.09375)

463# ArcPosition: False GDict(a12=49.475527, azi1=51.0, azi2=107.189397, lat1=40.6, lat2=51.884565, lon1=-73.8, lon2=-1.141174, m12=4844148.669561, M12=0.650911, M21=0.651229, s12=5499999.948497, S12=39735074737272.734375)

464

465# **) MIT License

466#

467# Copyright (C) 2016-2024 -- mrJean1 at Gmail -- All Rights Reserved.

468#

469# Permission is hereby granted, free of charge, to any person obtaining a

470# copy of this software and associated documentation files (the "Software"),

471# to deal in the Software without restriction, including without limitation

472# the rights to use, copy, modify, merge, publish, distribute, sublicense,

473# and/or sell copies of the Software, and to permit persons to whom the

474# Software is furnished to do so, subject to the following conditions:

475#

476# The above copyright notice and this permission notice shall be included

477# in all copies or substantial portions of the Software.

478#

479# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS

480# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

481# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

482# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR

483# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,

484# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR

485# OTHER DEALINGS IN THE SOFTWARE.