Coverage for pygeodesy/geodesicx/gxbases.py : 97%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*-
Copyright (C) Charles Karney (2012-2021) <Charles@Karney.com> and licensed under the MIT/X11 License. For more information, see U{GeographicLib<https://GeographicLib.SourceForge.io>}. '''
# from pygeodesy.props import Property # from .karney
# valid C{nC4}s and C{C4Order}s, see _xnC4 below # underflow guard, we require _TINY * EPS > 0, _TINY + EPS == EPS
'''(INTERNAL) Overriden by C{Caps} below. '''
_DEBUG_LINE | _ANGLE_ONLY | _SALPs_CALPs
'''I{Enum}-style masks to be bit-C{or}'ed to specify geodesic capabilities (C{caps}) and expected results (C{outmask}).
C{AREA} - compute area C{S12},
C{AZIMUTH} - include azimuths C{azi1} and C{azi2},
C{DISTANCE} - compute distance C{s12},
C{DISTANCE_IN} - allow distance C{s12} in C{.Direct},
C{EMPTY} - nothing, formerly aka C{NONE},
C{GEODESICSCALE} - compute geodesic scales C{M12} and C{M21},
C{LATITUDE} - compute latitude C{lat2},
C{LONGITUDE} - compute longitude C{lon2},
C{LONG_UNROLL} - unroll C{lon2} in C{.Direct},
C{REDUCEDLENGTH} - compute reduced length C{m12},
C{REVERSE2} - reverse C{azi2},
and C{ALL} - all of the above.
C{STANDARD} = C{AZIMUTH | DISTANCE | DISTANCE_IN | LATITUDE | LONGITUDE}'''
'''(INTERNAL) Base class for C{[_]Geodesic*Exact}. '''
# def toRepr(self, prec=6, sep=_COMMASPACE_, **unused): # PYCHOK signature # '''Return this C{GeodesicExact*} items string. # # @kwarg prec: The C{float} precision, number of decimal digits (0..9). # Trailing zero decimals are stripped for B{C{prec}} values # of 1 and above, but kept for negative B{C{prec}} values. # @kwarg sep: Optional separator to join (C{str}). # # @return: C{GeodesicExact*} (C{str}). # ''' # return Fmt.PAREN(self.named, self.toStr(prec=prec, sep=sep))
'''Get the C{debug} option (C{bool}). '''
'''Set the C{debug} option.
@arg debug: Include more details in results (C{bool}). '''
'''(INTERNAL) Check all available capabilities: C{True} if I{all} B{C{caps}} are available in B{C{_caps}}, C{False} otherwise (C{bool}). ''' caps &= Caps._OUT_ALL return (_caps & caps) == caps
'''(INTERNAL) I{Karney}'s cosine series expansion using U{Clenshaw summation<https://WikiPedia.org/wiki/Clenshaw_algorithm>}. '''
'''(INTERNAL) For C{_coeffs}. '''
'''(INTERNAL) Like C{GeographicLib.Math.hpp.polyval} but with a different signature and cascaded summation as C{karney._fsum2}.
@return: M{sum(c4s[k] * x**(j - k - 1) for k in range(i, j)} '''
'''(INTERNAL) Compute the C{sin12} and C{cos12} of M{ang12 = atan2(sin2, cos2) - atan2(sin1, cos1)}.
Use C{-sin1} to get C{sin12} and C{cos12} of the sum M{ang12 = atan2(sin2, cos2) + atan2(sin1, cos1)}.
@kwarg noneg: Limit C{sin12} to non-negative (C{bool}).
@return: 2-Tuple C{(sin12, cos12)}. ''' s = _0_0 # max(s, _0_0)
'''(INTERNAL) Validate C{C4Order}. ''' raise GeodesicError(n, nC4, txt=_not_(_or(*map(str, _nC4s))))
# **) MIT License # # Copyright (C) 2016-2022 -- mrJean1 at Gmail -- All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. |