Ë
    Ï.fÁÄ  ã                   ó”   — d Z ddlZddlZddlmZ ddlmZ ddlmZ  G d„ d«      Z	 e	ej                  ej                  «      e	_        y)aO  Define the :class:`~geographiclib.geodesic.Geodesic` class

The ellipsoid parameters are defined by the constructor.  The direct and
inverse geodesic problems are solved by

  * :meth:`~geographiclib.geodesic.Geodesic.Inverse` Solve the inverse
    geodesic problem
  * :meth:`~geographiclib.geodesic.Geodesic.Direct` Solve the direct
    geodesic problem
  * :meth:`~geographiclib.geodesic.Geodesic.ArcDirect` Solve the direct
    geodesic problem in terms of spherical arc length

:class:`~geographiclib.geodesicline.GeodesicLine` objects can be created
with

  * :meth:`~geographiclib.geodesic.Geodesic.Line`
  * :meth:`~geographiclib.geodesic.Geodesic.DirectLine`
  * :meth:`~geographiclib.geodesic.Geodesic.ArcDirectLine`
  * :meth:`~geographiclib.geodesic.Geodesic.InverseLine`

:class:`~geographiclib.polygonarea.PolygonArea` objects can be created
with

  * :meth:`~geographiclib.geodesic.Geodesic.Polygon`

The public attributes for this class are

  * :attr:`~geographiclib.geodesic.Geodesic.a`
    :attr:`~geographiclib.geodesic.Geodesic.f`

*outmask* and *caps* bit masks are

  * :const:`~geographiclib.geodesic.Geodesic.EMPTY`
  * :const:`~geographiclib.geodesic.Geodesic.LATITUDE`
  * :const:`~geographiclib.geodesic.Geodesic.LONGITUDE`
  * :const:`~geographiclib.geodesic.Geodesic.AZIMUTH`
  * :const:`~geographiclib.geodesic.Geodesic.DISTANCE`
  * :const:`~geographiclib.geodesic.Geodesic.STANDARD`
  * :const:`~geographiclib.geodesic.Geodesic.DISTANCE_IN`
  * :const:`~geographiclib.geodesic.Geodesic.REDUCEDLENGTH`
  * :const:`~geographiclib.geodesic.Geodesic.GEODESICSCALE`
  * :const:`~geographiclib.geodesic.Geodesic.AREA`
  * :const:`~geographiclib.geodesic.Geodesic.ALL`
  * :const:`~geographiclib.geodesic.Geodesic.LONG_UNROLL`

:Example:

    >>> from geographiclib.geodesic import Geodesic
    >>> # The geodesic inverse problem
    ... Geodesic.WGS84.Inverse(-41.32, 174.81, 40.96, -5.50)
    {'lat1': -41.32,
     'a12': 179.6197069334283,
     's12': 19959679.26735382,
     'lat2': 40.96,
     'azi2': 18.825195123248392,
     'azi1': 161.06766998615882,
     'lon1': 174.81,
     'lon2': -5.5}

é    N)ÚMath)Ú	Constants)ÚGeodesicCapabilityc                   ó²  — e Zd ZdZdZeZeZeZeZeZ	eZ
e
ZeZeedz
  z  dz  ZeZeedz   z  dz  ZdZeej$                  j&                  z   dz   Z ej,                  ej$                  j.                  «      Zej$                  j2                  Zdez  Z ej,                  e«      Zeez  Zdez  Zej@                  Z ejB                  Z!ejD                  Z"ejF                  Z#ejH                  Z$ejJ                  Z%ejL                  Z&ejN                  Z'ejP                  Z(ejR                  Z)e*d	„ «       Z+e*d
„ «       Z,e*d„ «       Z-e*d„ «       Z.e*d„ «       Z/e*d„ «       Z0e*d„ «       Z1d„ Z2d„ Z3d„ Z4d„ Z5d„ Z6d„ Z7d„ Z8d„ Z9d„ Z:d„ Z;d„ Z<ejz                  fd„Z>d„ Z?ejz                  fd„Z@ejz                  fd„ZAejz                  ej„                  z  fd„ZCejz                  ej„                  z  fd „ZDejz                  ej„                  z  fd!„ZEejz                  ej„                  z  fd"„ZFejz                  ej„                  z  fd#„ZGd&d$„ZHej’                  ZI	 ej”                  ZJ	 ej–                  ZK	 ej˜                  ZL	 ejš                  ZM	 ejz                  Z=	 ej„                  ZB	 ejœ                  ZN	 ejž                  ZO	 ej                   ZP	 ej¢                  ZQ	 ej¤                  ZRy%)'ÚGeodesiczSolve geodesic problemsé   é   é   é   é
   éÈ   iè  c                 óú   — t        |«      }|| z
  }d||z
  z  ||z   z  }d}|dz  r|dz  }||   }nd}|dz  }|r.|dz  }|dz  }||z  |z
  ||   z   }|dz  }||z  |z
  ||   z   }|rŒ.| rd|z  |z  |z  S |||z
  z  S )z9Private: Evaluate a trig series using Clenshaw summation.r
   r   r	   )Úlen)	ÚsinpÚsinxÚcosxÚcÚkÚnÚarÚy1Úy0s	            úUC:\Users\user\Documents\project_loop\venv\Lib\site-packages\geographiclib/geodesic.pyÚ_SinCosSerieszGeodesic._SinCosSeriesz   sÏ   € ô 	ˆA‹€AØ	ˆD‰€AØ	
ˆd�T‰kÑ	˜d T™kÑ	*€BØ	
€BØˆ1‚uØˆ1�f€a�1�Q‘4‰bà€bà	ˆQ‰€AÙ
Øˆ1�f€aàˆ1�f€a�2˜‘7˜R‘< ! A¡$Ñ&ˆbØˆ1�f€a�2˜‘7˜R‘< ! A¡$Ñ&ˆbò	 ñ
 &*ˆQ�‰X˜‰_˜rÑ!ð %Ø˜"˜r™'Ñ"ð%ó    c                 óF  — t        j                  | «      }t        j                  |«      }||z   dz
  dz  }|dk(  r|dk  �s^||z  dz  }t        j                  |«      }||z  }||d|z  z   z  }|}	|dk\  r`||z   }
|
|
dk  rt        j                  |«       nt        j                  |«      z  }
t        j                  |
«      }|	||dk7  r||z  ndz   z  }	nOt        j
                  t        j                  | «      ||z    «      }|	d|z  t        j                  |dz  «      z  z  }	t        j                  t        j                  |	«      |z   «      }|	dk  r|||	z
  z  n|	|z   }||z
  d|z  z  }|t        j                  |t        j                  |«      z   «      |z   z  }|S d}|S )z Private: solve astroid equation.r	   r   r   é   r
   é   )r   ÚsqÚmathÚsqrtÚcbrtÚatan2Úcos)ÚxÚyÚpÚqÚrÚSÚr2Úr3ÚdiscÚuÚT3ÚTÚangÚvÚuvÚwr   s                    r   Ú_AstroidzGeodesic._Astroid”   sœ  € ô
 	�‰�‹
€AÜ�‰�‹
€AØ	
ˆQ‰�‰�a‰€AØ�Š6�a˜1“fð ˆa‰%�!‰)€aÜ�7‰7�1‹:€bØˆr‰6€bð �!�a˜"‘f‘*Ñ€dØ
€aØ	�ŠØ�‰Vˆð 	 " q¢&Œt�y‰y˜‹Ñ¬d¯i©i¸«oÑ=ˆä�I‰I�b‹Mˆà	ˆQ˜A šF�"�q’&¨Ñ*Ñ*‰ô �j‰jœŸ™ D 5Ó)¨Q°©V¨9Ó5ˆð 	
ˆQ�‰U”T—X‘X˜c A™gÓ&Ñ&Ñ&ˆÜ
�)‰)”D—G‘G˜A“J ‘NÓ
#€aà˜aš%ˆ1��A‘Š; Q¨¡U€bØ�‰6�a˜!‘eÑ
€að ”—	‘	˜"œtŸw™w q›z™/Ó*¨QÑ.Ñ
/€að
 €Hð €aØ€Hr   c                 ó®   — g d¢}t         j                  dz  }t        j                  ||dt        j                  | «      «      ||dz      z  }|| z   d| z
  z  S )zPrivate: return A1-1.)r	   r   é@   r   é   r
   r   r	   )r   ÚnA1_r   Úpolyvalr   ©ÚepsÚcoeffÚmÚts       r   Ú_A1m1fzGeodesic._A1m1fÃ   óU   € ò€Eô 	�‰�qÑ€AÜ�‰�Q˜˜q¤$§'¡'¨#£,Ó/°%¸¸A¹±,Ñ>€AØ�‰G˜˜C™Ñ Ð r   c                 ó  — g d¢}t        j                  | «      }| }d}t        dt        j                  dz   «      D ]O  }t        j                  |z
  dz  }|t        j
                  ||||«      z  |||z   dz      z  ||<   ||dz   z  }|| z  }ŒQ y)zPrivate: return C1.)éÿÿÿÿr   éðÿÿÿé    é÷ÿÿÿr7   é€ÿÿÿé   é	   rD   é   r   éûÿÿÿé   éùÿÿÿé   rM   rH   r   r	   r
   N)r   r   Úranger   ÚnC1_r:   ©r<   r   r=   Úeps2ÚdÚoÚlr>   s           r   Ú_C1fzGeodesic._C1fÍ   ó™   € ò€Eô �7‰7�3‹<€DØ€AØ	€AÜ�1”h—m‘m aÑ'Ó(ò ˆÜ�=‰=˜1Ñ Ñ
"€aØ”—‘˜a ¨¨4Ó0Ñ0°5¸¸Q¹À¹Ñ3CÑC€aˆ�dØˆ1ˆq‰5�j€aØˆ3�h�añ	r   c                 ó  — g d¢}t        j                  | «      }| }d}t        dt        j                  dz   «      D ]O  }t        j                  |z
  dz  }|t        j
                  ||||«      z  |||z   dz      z  ||<   ||dz   z  }|| z  }ŒQ y)zPrivate: return C1')éÍ   iPþÿÿrJ   i   i¥  i€íÿÿi   i 0  iÿÿÿét   é€  iûãÿÿi‡
  é   i‹  r\   iÁ”  i ð  r   r	   r
   N)r   r   rO   r   ÚnC1p_r:   rQ   s           r   Ú_C1pfzGeodesic._C1pfá   s™   € ò€Eô �7‰7�3‹<€DØ€AØ	€AÜ�1”h—n‘n qÑ(Ó)ò ˆÜ�>‰>˜AÑ !Ñ
#€aØ”—‘˜a ¨¨4Ó0Ñ0°5¸¸Q¹À¹Ñ3CÑC€aˆ�dØˆ1ˆq‰5�j€aØˆ3�h�añ	r   c                 ó®   — g d¢}t         j                  dz  }t        j                  ||dt        j                  | «      «      ||dz      z  }|| z
  d| z   z  S )zPrivate: return A2-1)iõÿÿÿiäÿÿÿi@ÿÿÿr   r8   r
   r   r	   )r   ÚnA2_r   r:   r   r;   s       r   Ú_A2m1fzGeodesic._A2m1fõ   rA   r   c                 ó  — g d¢}t        j                  | «      }| }d}t        dt        j                  dz   «      D ]O  }t        j                  |z
  dz  }|t        j
                  ||||«      z  |||z   dz      z  ||<   ||dz   z  }|| z  }ŒQ y)zPrivate: return C2)r	   r
   é   rE   é#   r7   r[   rH   é   éP   rJ   é   rd   rL   é?   rN   éM   rH   r   r	   r
   N)r   r   rO   r   ÚnC2_r:   rQ   s           r   Ú_C2fzGeodesic._C2fÿ   rW   r   c           
      ó‚  — t        |«      | _        	 t        |«      | _        	 d| j                  z
  | _        | j                  d| j                  z
  z  | _        | j                  t        j                  | j                  «      z  | _        | j                  d| j                  z
  z  | _        | j                  | j                  z  | _	        t        j                  | j                  «      t        j                  | j                  «      | j                  dk(  rdnœ| j                  dkD  r2t        j                  t        j                  | j                  «      «      n2t        j                  t        j                  | j                   «      «      t        j                  t        | j                  «      «      z  z  z   dz  | _        dt         j"                  z  t        j                  t%        dt        | j                  «      «      t'        dd| j                  dz  z
  «      z  dz  «      z  | _        t        j*                  | j                  «      r| j                  dkD  st-        d«      ‚t        j*                  | j                  «      r| j                  dkD  st-        d«      ‚t/        t1        t         j2                  «      «      | _        t/        t1        t         j6                  «      «      | _        t/        t1        t         j:                  «      «      | _        | j?                  «        | jA                  «        | jC                  «        y	)
a  Construct a Geodesic object

    :param a: the equatorial radius of the ellipsoid in meters
    :param f: the flattening of the ellipsoid

    An exception is thrown if *a* or the polar semi-axis *b* = *a* (1 -
    *f*) is not a finite positive quantity.

    r	   r
   r   çš™™™™™¹?gü©ñÒMbP?ç      ð?z!Equatorial radius is not positivezPolar semi-axis is not positiveN)"ÚfloatÚaÚfÚ_f1Ú_e2r   r   Ú_ep2Ú_nÚ_br    Úatanhr!   ÚatanÚabsÚ_c2r   Útol2_ÚmaxÚminÚ_etol2ÚisfiniteÚ
ValueErrorÚlistrO   ÚnA3x_Ú_A3xÚnC3x_Ú_C3xÚnC4x_Ú_C4xÚ_A3coeffÚ_C3coeffÚ_C4coeff)Úselfrp   rq   s      r   Ú__init__zGeodesic.__init__  s*  € ô �1‹X€D„FØ4Ü�1‹X€D„FØ#Ø�4—6‘6‰z€D„HØ�v‰v˜˜TŸV™V™Ñ$€D„HØ—‘œ4Ÿ7™7 4§8¡8Ó,Ñ,€D„IØ�f‰f˜˜TŸV™V™Ñ$€D„GØ�f‰f�t—x‘xÑ€D„Gä—‘˜Ÿ™“¤$§'¡'¨$¯'©'Ó"2Ø—h‘h !’m‘Ø59·X±XÀ²\”$—*‘*œTŸY™Y t§x¡xÓ0Ô1Ü—)‘)œDŸI™I t§x¡x iÓ0Ó1Ü—‘œ3˜tŸx™x›=Ó)ñ*ñ#+ñ +ð -.ñ	.€D„Hð œŸ™Ñ&¬¯©´C¸¼sÀ4Ç6Á6»{Ó4KÜ47¸¸Q¸t¿v¹vÀa¹x¹ZÓ4Hñ5IØKLñ5Mó *Oñ O€D„Kä�=‰=˜Ÿ™Ô  T§V¡V¨a¢ZÜÐ:Ó;Ð;Ü�=‰=˜Ÿ™Ô! d§g¡g°¢kÜÐ8Ó9Ð9Ü”Uœ8Ÿ>™>Ó*Ó+€D„IÜ”Uœ8Ÿ>™>Ó*Ó+€D„IÜ”Uœ8Ÿ>™>Ó*Ó+€D„IØ‡M�M„OØ‡M�M„OØ‡M�M…Or   c                 ó*  — g d¢}d}d}t        t        j                  dz
  dd«      D ]j  }t        t        j                  |z
  dz
  |«      }t	        j
                  |||| j                  «      |||z   dz      z  | j                  |<   |dz  }||dz   z  }Œl y)z#Private: return coefficients for A3)éýÿÿÿé€   éþÿÿÿrŽ   r7   rC   rŽ   rC   rc   r   rC   r�   é   r	   rC   r
   r	   r	   r   r	   rC   r
   N)rO   r   ÚnA3_r}   r   r:   ru   rƒ   )r‹   r=   rT   r   Újr>   s         r   rˆ   zGeodesic._A3coeffC  s—   € ò€Eð 	
€Aˆqˆ1Ü”8—=‘= 1Ñ$ b¨"Ó-ò ˆÜ
Œh�m‰m˜aÑ !Ñ# QÓ
'€aÜ—\‘\ ! U¨A¨t¯w©wÓ7¸%ÀÀAÁÈÁ	Ñ:JÑJ€d‡i�i��lØˆ1�f€aØˆ1ˆq‰5�j�añ	r   c                 ón  — g d¢}d}d}t        dt        j                  «      D ]�  }t        t        j                  dz
  |dz
  d«      D ]j  }t        t        j                  |z
  dz
  |«      }t	        j
                  |||| j                  «      |||z   dz      z  | j                  |<   |dz  }||dz   z  }Œl Œ’ y)z#Private: return coefficients for C3)-r   r�   r
   é   r�   rC   r   r   r7   rC   r   r	   r‘   rC   r	   r   r•   r8   r	   r   r�   rŽ   r�   r   r7   r	   rŽ   r
   rE   rg   rL   iöÿÿÿrI   r[   r•   rF   r•   éÀ   rg   rL   iòÿÿÿrg   rL   é   i 
  r   r	   rC   r
   N)rO   r   ÚnC3_r}   r   r:   ru   r…   ©r‹   r=   rT   r   rU   r“   r>   s          r   r‰   zGeodesic._C3coeffT  sµ   € ò€Eð" 	
€Aˆqˆ1Ü�1”h—m‘mÓ$ò ˆÜ”X—]‘] QÑ&¨¨A©¨rÓ2ò ˆ!Ü”—‘ Ñ! AÑ% qÓ)ˆÜ—|‘| A u¨a°·±Ó9¸EÀ!ÀaÁ%È!Á)Ñ<LÑLˆ�	‰	�!‰Ø	ˆQ‰ˆØ	ˆQ�‰U‰
‰ñ	ñr   c                 óX  — g d¢}d}d}t        t        j                  «      D ]†  }t        t        j                  dz
  |dz
  d«      D ]`  }t        j                  |z
  dz
  }t        j                  |||| j
                  «      |||z   dz      z  | j                  |<   |dz  }||dz   z  }Œb Œˆ y)z#Private: return coefficients for C4)Méa   é§:  i@  éœ   éõ¯  i ÿÿÿiPíÿÿi%  rž   i`Öÿÿi@7  é îÿÿi¦üÿÿrž   r7   ip  rŸ   iÐ  iEôÿÿrœ   éd   éÐ   i<  ih  iÑÿÿiNu  rž   r	   i1#  i€ôÿÿiÔ  éß i   i  iùúÿÿr¢   i@  i€ÒÿÿiÀ#  iòõÿÿr¢   iÀÿÿÿi�ýÿÿià  i0åÿÿi»  r¢   r‘   iå)  i@  iXüÿÿéÉo i ßÿÿi€  iˆûÿÿr£   i`úÿÿi@  rŸ   i´  r£   ixÿÿÿiWö  i   i0ÿÿÿi‘š i   i óÿÿix  i³Ï rG   r¢   i öÿÿi@  i�/ r�   iƒ r   r	   rC   r
   N)rO   r   ÚnC4_r   r:   ru   r‡   r™   s          r   rŠ   zGeodesic._C4coeffo  s¬   € ò€Eð. 	
€Aˆqˆ1Ü”8—=‘=Ó!ò ˆÜ”X—]‘] QÑ&¨¨A©¨rÓ2ò ˆ!Ü�M‰M˜AÑ Ñ!ˆÜ—|‘| A u¨a°·±Ó9¸EÀ!ÀaÁ%È!Á)Ñ<LÑLˆ�	‰	�!‰Ø	ˆQ‰ˆØ	ˆQ�‰U‰
‰ñ	ñr   c                 óh   — t        j                  t        j                  dz
  | j                  d|«      S )zPrivate: return A3r	   r   )r   r:   r   r’   rƒ   )r‹   r<   s     r   Ú_A3fzGeodesic._A3f�  s&   € ô �<‰<œŸ™¨Ñ)¨4¯9©9°a¸Ó=Ð=r   c                 óà   — d}d}t        dt        j                  «      D ]M  }t        j                  |z
  dz
  }||z  }|t        j                  || j
                  ||«      z  ||<   ||dz   z  }ŒO y)zPrivate: return C3r	   r   N)rO   r   r˜   r   r:   r…   ©r‹   r<   r   ÚmultrT   rU   r>   s          r   Ú_C3fzGeodesic._C3f•  sr   € ð €DØ	€AÜ�1”h—m‘mÓ$ò ˆÜ
�-‰-˜!Ñ
˜aÑ
€aØ
ˆc�k€dØ”D—L‘L  D§I¡I¨q°#Ó6Ñ6€aˆ�dØˆ1ˆq‰5�j�añ	r   c                 óÞ   — d}d}t        t        j                  «      D ]M  }t        j                  |z
  dz
  }|t        j                  || j
                  ||«      z  ||<   ||dz   z  }||z  }ŒO y)zPrivate: return C4r	   r   N)rO   r   r¤   r   r:   r‡   r¨   s          r   Ú_C4fzGeodesic._C4f¡  sp   € ð €DØ	€AÜ”8—=‘=Ó!ò ˆÜ
�-‰-˜!Ñ
˜aÑ
€aØ”D—L‘L  D§I¡I¨q°#Ó6Ñ6€aˆ�dØˆ1ˆq‰5�j€aØ
ˆc�k�dñ	r   c                 óŠ  — |t         j                  z  }t        j                  x}x}x}x}}|t         j                  t         j
                  z  t         j                  z  z  r‰t         j                  |«      }t         j                  ||«       |t         j
                  t         j                  z  z  r5t         j                  |«      }t         j                  ||«       ||z
  }d|z   }d|z   }|t         j                  z  r t         j                  d|||«      t         j                  d|||«      z
  }||z   z  }|t         j
                  t         j                  z  z  rÑt         j                  d|||«      t         j                  d|||«      z
  }|z  ||z  |z  z
  z   }nŽ|t         j
                  t         j                  z  z  rjt        dt         j                  «      D ]  }||   z  ||   z  z
  ||<   Œ |z  t         j                  d|||«      t         j                  d|||«      z
  z   }|t         j
                  z  r}|||z  z  |||z  z  z
  ||z  z  z
  }|t         j                  z  rQ||z  ||z  z   }| j                  |	|
z
  z  |	|
z   z  ||z   z  }|||z  |z  z
  |z  |z  z   }|||z  ||z  z
  |z  |z  z
  }|||||fS )z"Private: return a bunch of lengthsr	   T)r   ÚOUT_MASKr    ÚnanÚDISTANCEÚREDUCEDLENGTHÚGEODESICSCALEr@   rV   ra   rk   r   rO   rj   rt   )r‹   r<   Úsig12Ússig1Úcsig1Údn1Ússig2Úcsig2Údn2Úcbet1Úcbet2ÚoutmaskÚC1aÚC2aÚs12bÚm12bÚm0ÚM12ÚM21ÚA1ÚA2Úm0xÚB1ÚB2ÚJ12rU   Úcsig12r?   s                               r   Ú_LengthszGeodesic._Lengths®  sÞ  € ð Œx× Ñ Ñ €Gô
 $(§8¡8Ð+€DÐ+ˆ4Ð+�"Ð+�s˜SØ”(×#Ñ#¤h×&<Ñ&<Ñ<Ü×(Ñ(ñ)ò *ä�?‰?˜3Ó€bÜ‡m�m�C˜ÔØ	”H×*Ñ*¬X×-CÑ-CÑCÒ	DÜ�_‰_˜SÓ!ˆÜ�‰�c˜3ÔØ�2‰gˆØ�‰VˆØˆr‰6€bØ”×"Ñ"Ò"Ü×"Ñ" 4¨°°sÓ;Ü×"Ñ" 4¨°°sÓ;ñ<€bð �5˜2‘:Ñ€dØ	”H×*Ñ*¬X×-CÑ-CÑCÒ	DÜ×$Ñ$ T¨5°%¸Ó=Ü×$Ñ$ T¨5°%¸Ó=ñ>ˆà�E‰k˜R "™W r¨B¡wÑ.Ñ/‰Ø	”H×*Ñ*¬X×-CÑ-CÑCÒ	Dä�QœŸ™Ó&ò +ˆ!Ø�c˜!‘f‘˜r C¨¡F™{Ñ*ˆˆAŠð+à�%‰Kœ8×1Ñ1°$¸¸uÀcÓJÜ#×1Ñ1°$¸¸uÀcÓJñKñ L€cà”×'Ñ'Ò'Ø€bð �U˜U‘]Ñ# c¨U°U©]Ñ&;Ñ;Ø�e‰m˜cÑ!ñ"€dà”×'Ñ'Ò'Ø�u‰}˜u u™}Ñ,€fØ
�)‰)�u˜u‘}Ñ
%¨°©Ñ
7¸3À¹9Ñ
E€aØ�a˜%‘i %¨#¡+Ñ-°Ñ6¸Ñ<Ñ<€cØ�a˜%‘i %¨#¡+Ñ-°Ñ6¸Ñ<Ñ<€cØ��r˜3 Ð#Ð#r   c                 ó|
  — d}t         j                  x}x}}||z  ||z  z
  }||z  ||z  z   }||z  }|||z  z  }|dk\  xr |dk  xr ||z  dk  }|r˜t        j                  ||z   «      }||t        j                  ||z   «      z   z  }t        j                  d| j
                  |z  z   «      }|| j                  |z  z  }t        j                  |«      }t        j                  |«      }n|}|	}||z  }|dk\  r$|||z  t        j                  |«      z  d|z   z  z   n#|||z  t        j                  |«      z  d|z
  z  z
  }t        j                  ||«      }||z  ||z  |z  z   }|rs|| j                  k  rd||z  }|||z  |dk\  rt        j                  |«      d|z   z  nd|z
  z  z
  }t        j                  ||«      \  }}t        j                  ||«      }�n:t        | j                  «      dk\  sG|dk\  sB|dt        | j                  «      z  t         j                  z  t        j                  |«      z  k\  r�nÙt        j                  | |	 «      }| j                   dk\  rˆt        j                  |«      | j
                  z  }|ddt        j                  d|z   «      z   z  |z   z  }| j                   |z  | j#                  |«      z  t         j                  z  }||z  } ||z  }!|| z  }"nÕ||z  ||z  z
  }#t        j                  ||#«      }$| j%                  | j                  t         j                  |$z   || ||||||t&        j(                  |
|«      \  }%}&}'}%}%d|&||z  |'z  t         j                  z  z  z   }!|!dk  r||!z  n3| j                    t        j                  |«      z  t         j                  z  } | |z  }||z  }"|"t&        j*                   kD  r­|!dt&        j,                  z
  kD  r—| j                   dk\  r:t/        d	|! «      }t        j                  dt        j                  |«      z
  «       }nât1        |!t&        j*                   kD  rd
nd|!«      }t        j                  dt        j                  |«      z
  «      }n”t&        j3                  |!|"«      }(|| j                   dk\  r|! |(z  d|(z   z  n|" d|(z   z  |(z  z  })t        j                  |)«      }t        j                  |)«       }||z  }|||z  t        j                  |«      z  d|z
  z  z
  }|dk  st        j                  ||«      \  }}nd}d}||||||fS )z3Private: Find a starting value for Newton's method.rC   r   g      à?r	   rm   r   r
   g{®Gáz„¿rn   ç        ç      ð¿)r    r¯   r   r   r!   rt   rr   Úsinr$   Úhypotr~   Únormr#   ry   ru   Úpirq   r¦   rË   r   r±   Útol1_Úxthresh_r}   r|   r5   )*r‹   Úsbet1rº   r¶   Úsbet2r»   r¹   Úlam12Úslam12Úclam12r½   r¾   r³   Úsalp2Úcalp2ÚdnmÚsbet12Úcbet12Úsbet12aÚ	shortlineÚsbetm2Úomg12Úsomg12Úcomg12Úsalp1Úcalp1Ússig12rÊ   Úlam12xÚk2r<   ÚlamscaleÚbetscaler%   r&   Úcbet12aÚbet12aÚdummyrÀ   rÁ   r   Úomg12as*                                             r   Ú_InverseStartzGeodesic._InverseStartä  s  € ð €E¤d§h¡hÐ.�Ð.˜ à�U‰]˜U U™]Ñ*€FØ�U‰]˜U U™]Ñ*€Fð �e‰m€GØˆu�u‰}Ñ€Gà˜!‘ÒD ¨¡ÒD°¸±ÀÑ1D€IÙÜ�w‰w�u˜u‘}Ó%€fð �œŸ™ ¨¡Ó/Ñ/Ñ/€fÜ�I‰I�a˜$Ÿ)™) fÑ,Ñ,Ó-€cØ�t—x‘x #‘~Ñ&€eÜ�x‰x˜‹€f¬¯©°%«¡à€f �và�F‰N€EàAGÈ1Â€fˆu�u‰}œtŸw™w v›Ñ.°!°f±*Ñ=Ò=Ø�U˜U‘]¤T§W¡W¨V£_Ñ4¸¸F¹
ÑCÑCð 
ô �Z‰Z˜˜uÓ%€FØ�U‰]˜U U™]¨VÑ3Ñ3€Fá�V˜dŸk™kÒ)à�f‰n€eØ�u˜u‘}Ø+1°Qª;ô )-¯©°«¸1¸v¹:Ò(FØ<=À¹JñHñ H€eä—Y‘Y˜u eÓ,�l€eˆUä�j‰j˜ Ó(‚eÜ
ˆd�g‰g‹,˜#Ò
Ø
�AŠ+Ø
�Aœ˜DŸG™G›Ñ$¤t§w¡wÑ.´·±¸³Ñ?Ò
?á
ô
 �z‰z˜6˜' F 7Ó+€fØ	�‰�1Šä�W‰W�U‹^˜dŸi™iÑ'ˆØ�A˜œTŸY™Y q¨2¡vÓ.Ñ.Ñ/°"Ñ4Ñ5ˆØ—6‘6˜E‘> D§I¡I¨c£NÑ2´T·W±WÑ<ˆØ˜eÑ#ˆØ�XÑˆØ�hÑ‰ð ˜%‘- %¨%¡-Ñ/ˆÜ—‘˜G WÓ-ˆð )-¯©Ø
�'‰'”4—7‘7˜VÑ# U¨U¨F°C¸ÀÀsØ
�œ×.Ñ.°°Só):Ñ%ˆˆt�R˜ ð �˜ ™¨Ñ+¬d¯g©gÑ5Ñ6Ñ6ˆØ#$ u¢9�G˜a’KØŸ&™&˜¤4§7¡7¨5£>Ñ1´D·G±GÑ;ð 	à˜eÑ#ˆØ�XÑˆà	
Œh�n‰nˆ_Ò	  R¬(×*;Ñ*;Ñ%;Ò!;à�6‰6�QŠ;Ü�c˜A˜2“,ˆ%¬$¯)©)°A¼¿¹À»Ñ4FÓ*GÐ(G¡ä˜a¤8§>¡> /Ò1‘s°t¸aÓ@ˆ%Ü—)‘)˜A¤§¡¨£Ñ.Ó/‰%ôH ×Ñ˜a Ó#ˆØ°·±¸!²˜q˜b 1™f a¨!¡ešnØ$% 2¨¨Q©¡<°¡>ñ4ˆä—‘˜&Ó!ˆ¬T¯X©X°fÓ-=Ð,= 6à˜‘ˆØ˜% %™-¬$¯'©'°&«/Ñ9¸QÀ¹ZÑHÑHˆà�QŠJÜ—Y‘Y˜u eÓ,�l€e‰Uà€e˜�Ø�%˜  u¨cÐ1Ð1r   c                 ój  — |dk(  r|dk(  rt         j                   }||z  }t        j                  |||z  «      }|}||z  }||z  x}}t	        j
                  ||«      \  }}||k7  r||z  n|}||k7  st        |«      | k7  rKt        j                  t	        j                  ||z  «      || k  r||z
  ||z   z  n
||z
  ||z   z  z   «      |z  n
t        |«      }|}||z  }||z  x}}t	        j
                  ||«      \  }}t        j                  t        d||z  ||z  z
  «      dz   ||z  ||z  z   «      }t        d||z  ||z  z
  «      dz   }||z  ||z  z   }t        j                  ||
z  ||	z  z
  ||
z  ||	z  z   «      }t	        j                  |«      | j                  z  }|ddt        j                  d|z   «      z   z  |z   z  } | j                  | |«       t         j                  d|||«      t         j                  d|||«      z
  }!| j                   | j                  | «      z  |z  ||!z   z  }"||"z   }#|rb|dk(  rd| j                   z  |z  |z  }$nW| j#                  | |||||||||t         j$                  ||«      \  }%}$}%}%}%|$| j                   ||z  z  z  }$nt        j&                  }$|#|||||||| |"|$fS )zPrivate: Solve hybrid problemr   rÍ   r
   r	   Tr�   )r   Útiny_r    rÐ   r   rÑ   ry   r!   r   r#   r|   rt   rª   r   rq   r¦   rr   rË   r±   r¯   )&r‹   rÕ   rº   r¶   rÖ   r»   r¹   rå   ræ   Úslam120Úclam120Údiffpr½   r¾   ÚC3aÚsalp0Úcalp0r´   Úsomg1rµ   Úcomg1rÚ   rÛ   r·   Úsomg2r¸   Úcomg2r³   rã   rä   Úetaré   r<   ÚB312Údomg12r×   Údlam12rî   s&                                         r   Ú	_Lambda12zGeodesic._Lambda12p  s  € ð
 �‚z�e˜q’jô �~‰~ˆo€eð �E‰M€EÜ�J‰J�u˜e e™mÓ,€Eð
 €E˜5 5™=�5Ø˜E‘MÐ!€EˆEÜ—9‘9˜U EÓ*�L€Eˆ5ð # eš^ˆE�EŠM°€Eð ˜’¤# e£*°°Ò"6ô �Y‰Y”t—w‘w˜u u™}Ó-Ø=BÀeÀVº^˜ ™¨5°5©=Ò9Ø# e™m°¸±Ñ>ñ@ó AàCHòIô =@À»Jð 
ð €E˜5 5™=�5Ø˜E‘MÐ!€EˆEÜ—9‘9˜U EÓ*�L€Eˆ5ô �J‰J”s˜3 ¨¡°¸±Ñ =Ó>ÀÑDØ %¨¡°¸±Ñ =ó?€Eô ��e˜e‘m e¨e¡mÑ3Ó4°sÑ:€FØ˜e‘m e¨e¡mÑ3€Fä
�*‰*�V˜gÑ%¨°Ñ(8Ñ8Ø˜gÑ%¨°Ñ(8Ñ8ó:€Cô 
�‰�‹˜$Ÿ)™)Ñ	#€BØ
��QœŸ™ 1 r¡6Ó*Ñ*Ñ+¨bÑ0Ñ
1€CØ‡I�Iˆc�3ÔÜ×"Ñ" 4¨°°sÓ;Ü×"Ñ" 4¨°°sÓ;ñ<€Dà�v‰vˆg˜Ÿ	™	 #›Ñ&¨Ñ.°%¸$±,Ñ?€FØ�&‰L€EáØ	�!ŠØ�t—x‘x‘ #Ñ%¨Ñ-‰à-1¯]©]Ø
ˆu�e˜U C¨°°s¸EÀ5Ü
×
 Ñ
  # só.,Ñ*ˆˆv�u˜e Uð 	�$—(‘(˜e e™mÑ,Ñ,‰ä�x‰x€fà�5˜% ¨¨u°e¸UÀCØ�Fðð r   c                 ó^  — t         j                  x}x}x}x}	x}
}|t        j                  z  }t	        j
                  ||«      \  }}t        j                  d|«      }||z  }||z  }t        j                  |«      }t	        j                  ||«      \  }}d|z
  |z
  }t	        j                  t	        j                  |«      «      }t	        j                  t	        j                  |«      «      }t        |«      t        |«      k  st        j                  |«      rdnd}|dk  r	|dz  }||}}t        j                  d| «      }||z  }||z  }t	        j                  |«      \  }}|| j                  z  }t	        j                  ||«      \  }}t!        t        j"                  |«      }t	        j                  |«      \  }}|| j                  z  }t	        j                  ||«      \  }}t!        t        j"                  |«      }|| k  r||k(  r(t        j                  ||«      }nt        |«      | k(  r|}t        j$                  d| j&                  t	        j(                  |«      z  z   «      }t        j$                  d| j&                  t	        j(                  |«      z  z   «      }t+        t-        t        j.                  dz   «      «      }t+        t-        t        j0                  dz   «      «      }t+        t-        t        j2                  «      «      }|dk(  xs |dk(  }|�r|}|}d} d}!|}"||z  }#|}$| |z  }%t        j4                  t!        d|#|$z  |"|%z  z
  «      dz   |#|%z  |"|$z  z   «      }&| j7                  | j8                  |&|"|#||$|%||||t        j:                  z  t        j<                  z  ||«      \  }'}(})}	}
|&dk  s|(dk\  rm|&dt        j"                  z  k  s|&t        j>                  k  r|'dk  s|(dk  rdx}&x}(}'|(| j@                  z  }(|'| j@                  z  }'t        jB                  |&«      }nd	}d
}*d}+d},|s«|dk(  r¦| jD                  dk  s|| jD                  dz  k\  r…dx}} dx}}!| jF                  |z  }'|| j                  z  x}&},| j@                  t        jH                  |&«      z  }(|t        jJ                  z  rt        jL                  |&«      x}	}
|| j                  z  }�nø|�sõ| jO                  |||||||||||«      \  }&}}}!} }-|&dk\  r£|&| j@                  z  |-z  }'t	        j(                  |-«      | j@                  z  t        jH                  |&|-z  «      z  }(|t        jJ                  z  rt        jL                  |&|-z  «      x}	}
t        jB                  |&«      }|| j                  |-z  z  },�n+d}.d	x}/}0t        j"                  }1d}2t        j"                  }3d}4|.t        jP                  k  �rý| jS                  |||||||||||.t        jT                  k  |||«      \  }5}!} }&}"}#}$}%}6}7}8|0s#t        |5«      |/rdndt        j>                  z  k\  s�n›|5dkD  r#|.t        jT                  kD  s||z  |4|3z  kD  r|}3|}4n'|5dk  r"|.t        jT                  kD  s||z  |2|1z  k  r|}1|}2|.dz  }.|.t        jT                  k  r¨|8dkD  r£|5 |8z  }9t        jH                  |9«      }:t        jL                  |9«      };||;z  ||:z  z   }<|<dkD  rct        |9«      t         jV                  k  rG||;z  ||:z  z
  }|<}t	        j                  ||«      \  }}t        |5«      dt        j>                  z  k  }/�Œ…|1|3z   dz  }|2|4z   dz  }t	        j                  ||«      \  }}d	}/t        |1|z
  «      |2|z
  z   t        jX                  k  xs% t        ||3z
  «      ||4z
  z   t        jX                  k  }0|.t        jP                  k  r�Œý||t        j<                  t        jJ                  z  z  rt        j:                  nt        jZ                  z  }=| j7                  6|&"#|$%||||=||«      \  }'}(})}	}
|(| j@                  z  }(|'| j@                  z  }'t        jB                  |&«      }|t        j\                  z  r@t        jH                  7«      }>t        jL                  |7«      }?||?z  ||>z  z
  }*||?z  ||>z  z   }+|t        j:                  z  rd'z   }|t        j<                  z  rd(z   }|t        j\                  z  �r?|z  }@t        j^                  ||z  «      }A|Adk7  �r+@dk7  �r%|}"||z  }#|}$ |z  }%t	        j(                  A«      | j&                  z  }B|Bddt        j$                  d|Bz   «      z   z  |Bz   z  }6t	        j(                  | jF                  «      |Az  @z  | j`                  z  }Ct	        j                  |"|#«      \  }"}#t	        j                  |$|%«      \  }$}%t+        t-        t        jb                  «      «      }D| je                  |6|D«       t        jg                  d	|"|#|D«      }Et        jg                  d	|$|%|D«      }F|C|F|Ez
  z  }nd}|s/|*d
k(  r*t        jH                  |,«      }*t        jL                  |,«      }+|sN|+dkD  rI||z
  dk  rAd|+z   }7d|z   }Gd|z   }Hdt        j4                  |*||Hz  ||Gz  z   z  |7||z  |G|Hz  z   z  «      z  }InK!|z   |z  z
  }J| |z  |!|z  z   }K|Jdk(  rKdk  rt        j"                  |z  }Jd}Kt        j4                  JK«      }I|| jh                  Iz  z  }|||z  |z  z  }|dz  }|dk  r!}}! }} |t        jJ                  z  r|	|
}	}
||z  z  }||z  z  }!||z  z  }! ||z  z  } |||||!| ||	|
|f
S )z/Private: General version of the inverse problemr	   é´   rC   r   i¦ÿÿÿrn   rÍ   r   Fg       @rÎ   r‘   rc   r
   gà-� æ¿g      ü?)5r    r¯   r   r®   r   ÚAngDiffÚcopysignÚradiansÚsincosdeÚAngRoundÚLatFixry   ÚisnanÚsincosdrr   rÑ   r|   rò   r!   rt   r   r�   rO   rP   rj   r˜   r#   rË   ru   r°   r±   Útol0_rv   Údegreesrq   rp   rÏ   r²   r$   rð   Úmaxit2_r  Úmaxit1_rÒ   Útolb_ÚEMPTYÚAREArÐ   rs   r¤   r¬   r   rz   )Lr‹   Úlat1Úlon1Úlat2Úlon2r¼   Úa12Ús12Úm12rÂ   rÃ   ÚS12Úlon12Úlon12sÚlonsignr×   rØ   rÙ   ÚswappÚlatsignrÕ   rº   rÖ   r»   r¶   r¹   r½   r¾   rö   Úmeridianræ   rå   rÛ   rÚ   r´   rµ   r·   r¸   r³   Ús12xÚm12xrî   rã   rä   râ   rÜ   ÚnumitÚtripnÚtripbÚsalp1aÚcalp1aÚsalp1bÚcalp1br2   r<   rÿ   ÚdvÚdalp1Úsdalp1Úcdalp1Únsalp1Ú
lengthmaskÚsdomg12Úcdomg12r÷   rø   ré   ÚA4ÚC4aÚB41ÚB42Údbet1Údbet2Úalp12Úsalp12Úcalp12sL                                                                               r   Ú_GenInversezGeodesic._GenInverse½  sh  € ä(,¯©Ð0€CÐ0ˆ#Ð0�Ð0�cÐ0˜C #àŒx× Ñ Ñ €Gô —L‘L  tÓ,�M€Eˆ6ä�m‰m˜A˜uÓ%€GØ�e‰O€E g°Ñ&6˜VÜ�L‰L˜Ó€Eä—]‘] 5¨&Ó1�N€FˆFØ�E‰k˜VÑ#€Fô �=‰=œŸ™ TÓ*Ó+€DÜ�=‰=œŸ™ TÓ*Ó+€Dô �d“)œc $›iÒ'¬4¯:©:°dÔ+;‰BÀ€EØˆq‚yØ��m€gØ˜ˆD€dä�m‰m˜A ˜uÓ%€GØˆG�O€DØˆG�O€Dô —<‘< Ó%�L€Eˆ5 u°·±Ñ'8 uä—9‘9˜U EÓ*�L€Eˆ5´C¼¿¹ÈÓ4N¨Eä—<‘< Ó%�L€Eˆ5 u°·±Ñ'8 uä—9‘9˜U EÓ*�L€Eˆ5´C¼¿¹ÈÓ4N¨Eð �ˆv‚~Ø	�%ŠÜ—‘˜e UÓ+‰ä	ˆU‹˜�vÒ	Øˆä
�)‰)�A˜Ÿ	™	¤D§G¡G¨E£NÑ2Ñ2Ó
3€CÜ
�)‰)�A˜Ÿ	™	¤D§G¡G¨E£NÑ2Ñ2Ó
3€Cô Œu”X—]‘] QÑ&Ó'Ó
(€CÜ
Œu”X—]‘] QÑ&Ó'Ó
(€CÜ
Œu”X—]‘]Ó#Ó
$€Cà�s‰{Ò)˜f¨™k€Hâð
 €e˜f�eØ€e˜3�5ð €e˜U U™]�UØ€e˜U U™]�Uô �j‰jœ˜S %¨%¡-°%¸%±-Ñ"?Ó@À3ÑFØ"'¨%¡-°%¸%±-Ñ"?óA€eð %)§M¡MØ�‰�˜˜u c¨5°%¸¸eÀUØ”(×#Ñ#Ñ#¤h×&<Ñ&<Ñ<¸cÀ3ó%HÑ!€dˆD�%˜˜cð 
�Š�d˜a’iØ�AœŸ™Ñ&Ò&à”X—^‘^Ò#¨°ª°T¸A²XØ #Ð
#ˆ%Ð
#�$˜Ø�—‘‰ˆØ�—‘‰ˆÜ�l‰l˜5Ó!‰ð ˆð €F˜3�&¨ ÙØ�Š
à	�‰�1Š˜ $§&¡&¨3¡,Ò.ð Ð€eˆe¨3Ð.˜5 5Ø�V‰V�e‰^€dØ˜dŸh™hÑ&Ð&€eˆeØ�W‰W”t—x‘x “Ñ&€dØ	”8×)Ñ)Ò	)Ü—H‘H˜U“OÐ#ˆˆcØ�D—H‘HÑ‚câð 04×/AÑ/AØˆu�c˜5 %¨¨e°V¸VÀSÈ#ó0OÑ,€eˆU�E˜5 %¨ð 
�!Šà�t—w‘w‰ Ñ$ˆÜ—‘˜“˜tŸw™wÑ&¬¯©°%¸#±+Ó)>Ñ>ˆØ”X×+Ñ+Ò+Ü—h‘h˜u s™{Ó+Ð
+ˆ#�Ü�l‰l˜5Ó!ˆØ˜Ÿ™ C™Ñ(Šð ˆØÐˆ�ä—‘ˆ¨# Ü—‘ˆ¨$ à”h×&Ñ&Ó&ð #Ÿn™nØ�E˜3  u¨cØ�E˜6 6¨5´8×3CÑ3CÑ+CØ�#�sóñˆ1ˆe�U˜E 5¨%°¸Ø�˜ñ
 œ3˜q›6©5¡a°a¼8¿>¹>Ñ%IÒIÙà�ŠU˜¤× 0Ñ 0Ò0Ø˜e™ f¨V¡mÒ3ØˆF U™FØ�1Šu˜%¤(×"2Ñ"2Ò2Ø ™+¨¨v©Ò5ØˆF U˜Fà
�1‰*ˆ%Ø”X×%Ñ%Ò%¨"¨qª&Ø�B�r‘EˆEÜ—X‘X˜e“_ˆF¬t¯x©x¸« fØ˜V‘^ e¨f¡nÑ4ˆFØ˜Šzœc %›j¬4¯7©7Ò2Ø˜f‘n u¨v¡~Ñ5ˆeØˆeÜ!ŸY™Y u¨eÓ4‰lˆe�Uô ˜!“f ¤X§^¡^Ñ 3Ñ3ˆeÙð ˜F‘? AÑ%ˆ%Ø˜F‘? AÑ%ˆ%ÜŸ™ 5¨%Ó0‰,ˆ%�Øˆ%Ü�v ‘~Ó&¨&°5©.Ñ9¼H¿N¹NÑJò KÜ�u˜v‘~Ó&¨%°&©.Ñ9¼H¿N¹NÑJð ð[ ”h×&Ñ&Ô&ð` à"¤h×&<Ñ&<Ü&.×&<Ñ&<ñ'=ò >ô  ×(Ò(ô %ŸN™Nñ	,ˆ
ð
 '+§m¡mØ
ˆu�e˜U C¨°°s¸EÀ5Ø
�c˜3ó' Ñ#ˆˆd�E˜3 ð 	�—‘‰ˆØ�—‘‰ˆÜ�l‰l˜5Ó!ˆØ”X—]‘]Ò"ä—H‘H˜VÓ$ˆ'´·±¸Ó0@ gØ˜GÑ# f¨wÑ&6Ñ6ˆ&Ø˜GÑ# f¨wÑ&6Ñ6ˆ&ð ”×"Ñ"Ò"Ø�$‰J€cà”×'Ñ'Ò'Ø�$‰J€cà”—‘Óà�e‰m€eÜ�j‰j˜ ¨¡Ó.€eà	�!‹˜ ›
àˆ˜u u™}�uØˆ˜u u™}�uÜ�W‰W�U‹^˜dŸi™iÑ'ˆØ�A˜œTŸY™Y q¨2¡vÓ.Ñ.Ñ/°"Ñ4Ñ5ˆä�W‰W�T—V‘V‹_˜uÑ$ uÑ,¨t¯x©xÑ7ˆÜ—y‘y ¨Ó.‰ˆˆuÜ—y‘y ¨Ó.‰ˆˆuÜ”5œŸ™Ó'Ó(ˆØ�	‰	�#�sÔÜ×$Ñ$ U¨E°5¸#Ó>ˆÜ×$Ñ$ U¨E°5¸#Ó>ˆØ�C˜#‘IÑ‰ð ˆá˜& Cš-Ü—‘˜%“ˆ¬4¯8©8°E«? &áà
�7Ò
Ø
�%‰-˜$Ò
ð �V‘ˆ Q¨¡Y˜U¸¸E¹	°Ø”D—J‘J ¨5°5©=¸5À5¹=Ñ+HÑ JØ &¨5°5©=¸5À5¹=Ñ+HÑ JóMñ M‰ð ˜‘ ¨¡Ñ.ˆØ˜‘ ¨¡Ñ.ˆð
 �QŠ;˜6 Aš:Ü—>‘> EÑ)ˆ&Øˆ&Ü—
‘
˜6 6Ó*ˆØ	ˆT�X‰X˜ÑÑ€cØ	ˆU�W‰_˜wÑ&Ñ&€cà	ˆS�j€cð ˆq‚yØ˜EˆU€eØ˜EˆU€eØ	”8×)Ñ)Ò	)Ø˜ˆSˆà	ˆU�W‰_Ñ€E˜e u¨w¡Ñ6˜eØ	ˆU�W‰_Ñ€E˜e u¨w¡Ñ6˜eà��U˜E 5¨%°°c¸3ÀÐCÐCr   c           
      ó  — | j                  |||||«      \
  }}}}	}
}}}}}|t        j                  z  }|t        j                  z  r"t	        j
                  ||«      \  }}||z   |z   }nt	        j                  |«      }t	        j                  |«      |t        j                  z  r|nt	        j                  |«      t	        j                  |«      |dœ}||d<   |t        j                  z  r||d<   |t        j                  z  r2t	        j                  ||	«      |d<   t	        j                  |
|«      |d<   |t        j                  z  r||d<   |t        j                  z  r
||d<   ||d<   |t        j                  z  r||d	<   |S )
a7  Solve the inverse geodesic problem

    :param lat1: latitude of the first point in degrees
    :param lon1: longitude of the first point in degrees
    :param lat2: latitude of the second point in degrees
    :param lon2: longitude of the second point in degrees
    :param outmask: the :ref:`output mask <outmask>`
    :return: a :ref:`dict`

    Compute geodesic between (*lat1*, *lon1*) and (*lat2*, *lon2*).
    The default value of *outmask* is STANDARD, i.e., the *lat1*,
    *lon1*, *azi1*, *lat2*, *lon2*, *azi2*, *s12*, *a12* entries are
    returned.

    )r  r  r  r  r  r  Úazi1Úazi2r  rÂ   rÃ   r  )r;  r   r®   ÚLONG_UNROLLr   r  ÚAngNormalizer	  r°   ÚAZIMUTHÚatan2dr±   r²   r  )r‹   r  r  r  r  r¼   r  r  rå   ræ   rÚ   rÛ   r  rÂ   rÃ   r  r  ÚeÚresults                      r   ÚInversezGeodesic.Inverseô  sj  € ð$ >B×=MÑ=MØ
ˆD�$˜˜gó>'Ñ:€Cˆˆe�E˜5 ¨¨S°#°sàŒx× Ñ Ñ €GØ”×%Ñ%Ò%Ü—‘˜d DÓ)�h€eˆQØ�U‰l˜aÑ�dä×Ñ˜tÓ$€dÜ—k‘k $Ó'Ø%¬×(<Ñ(<Ò<‘dÜ×Ñ Ó%Ü—k‘k $Ó'Øñ	€Fð
 €Fˆ5�MØ”×"Ñ"Ò"°C F¨5¡MØ”×!Ñ!Ò!Ü—{‘{ 5¨%Ó0€fˆV�nÜ—{‘{ 5¨%Ó0€fˆV�nØ”×'Ñ'Ò'¸¨°©Ø”×'Ñ'Ò'Ø€fˆU�m¨3˜6 %™=Ø”—‘Ò°  u¡Ø€Mr   c                 óv   — ddl m} |s|t        j                  z  } || ||||«      }|j	                  |||«      S )z*Private: General version of direct problemr   ©ÚGeodesicLine)Úgeographiclib.geodesiclinerH  r   ÚDISTANCE_INÚ_GenPosition)	r‹   r  r  r=  ÚarcmodeÚs12_a12r¼   rH  Úlines	            r   Ú
_GenDirectzGeodesic._GenDirect  s>   € å7á�Gœx×3Ñ3Ñ3�GÙ˜˜d D¨$°Ó8€DØ×Ñ˜W g¨wÓ7Ð7r   c           	      óJ  — | j                  |||d||«      \	  }}}}	}}
}}}|t        j                  z  }t        j                  |«      |t        j
                  z  r|nt        j                  |«      t        j                  |«      |dœ}||d<   |t        j                  z  r||d<   |t        j                  z  r||d<   |t        j                  z  r|	|d<   |t        j                  z  r|
|d<   |t        j                  z  r
||d<   ||d	<   |t        j                  z  r||d
<   |S )a_  Solve the direct geodesic problem

    :param lat1: latitude of the first point in degrees
    :param lon1: longitude of the first point in degrees
    :param azi1: azimuth at the first point in degrees
    :param s12: the distance from the first point to the second in
      meters
    :param outmask: the :ref:`output mask <outmask>`
    :return: a :ref:`dict`

    Compute geodesic starting at (*lat1*, *lon1*) with azimuth *azi1*
    and length *s12*.  The default value of *outmask* is STANDARD, i.e.,
    the *lat1*, *lon1*, *azi1*, *lat2*, *lon2*, *azi2*, *s12*, *a12*
    entries are returned.

    F)r  r  r=  r  r  r  r  r>  r  rÂ   rÃ   r  )rO  r   r®   r   r	  r?  r@  ÚLATITUDEÚ	LONGITUDErA  r±   r²   r  )r‹   r  r  r=  r  r¼   r  r  r  r>  r  rÂ   rÃ   r  rD  s                  r   ÚDirectzGeodesic.Direct'  s  € ð& 6:·_±_Ø
ˆD�$˜˜s Gó6-Ñ2€Cˆˆt�T˜3  S¨#¨sàŒx× Ñ Ñ €GÜ—k‘k $Ó'Ø%¬×(<Ñ(<Ò<‘dÜ×Ñ Ó%Ü×'Ñ'¨Ó-Øñ	€Fð
 €Fˆ5�MØ”×"Ñ"Ò"°T F¨6¡NØ”×#Ñ#Ò#°d V¨F¡^Ø”×!Ñ!Ò!°D 6¨&¡>Ø”×'Ñ'Ò'¸¨°©Ø”×'Ñ'Ò'Ø€fˆU�m¨3˜6 %™=Ø”—‘Ò°  u¡Ø€Mr   c           	      óp  — | j                  |||d||«      \	  }}}}}	}
}}}|t        j                  z  }t        j                  |«      |t        j
                  z  r|nt        j                  |«      t        j                  |«      |dœ}|t        j                  z  r|	|d<   |t        j                  z  r||d<   |t        j                  z  r||d<   |t        j                  z  r||d<   |t        j                  z  r|
|d<   |t        j                  z  r
||d<   ||d	<   |t        j                  z  r||d
<   |S )a�  Solve the direct geodesic problem in terms of spherical arc length

    :param lat1: latitude of the first point in degrees
    :param lon1: longitude of the first point in degrees
    :param azi1: azimuth at the first point in degrees
    :param a12: spherical arc length from the first point to the second
      in degrees
    :param outmask: the :ref:`output mask <outmask>`
    :return: a :ref:`dict`

    Compute geodesic starting at (*lat1*, *lon1*) with azimuth *azi1*
    and arc length *a12*.  The default value of *outmask* is STANDARD,
    i.e., the *lat1*, *lon1*, *azi1*, *lat2*, *lon2*, *azi2*, *s12*,
    *a12* entries are returned.

    T)r  r  r=  r  r  r  r  r>  r  rÂ   rÃ   r  )rO  r   r®   r   r	  r?  r@  r°   rQ  rR  rA  r±   r²   r  )r‹   r  r  r=  r  r¼   r  r  r>  r  r  rÂ   rÃ   r  rD  s                  r   Ú	ArcDirectzGeodesic.ArcDirectL  s,  € ð& 6:·_±_Ø
ˆD�$˜˜c 7ó6,Ñ2€Cˆˆt�T˜3  S¨#¨sàŒx× Ñ Ñ €GÜ—k‘k $Ó'Ø%¬×(<Ñ(<Ò<‘dÜ×Ñ Ó%Ü×'Ñ'¨Ó-Øñ	€Fð
 ”×"Ñ"Ò"°C F¨5¡MØ”×"Ñ"Ò"°T F¨6¡NØ”×#Ñ#Ò#°d V¨F¡^Ø”×!Ñ!Ò!°D 6¨&¡>Ø”×'Ñ'Ò'¸¨°©Ø”×'Ñ'Ò'Ø€fˆU�m¨3˜6 %™=Ø”—‘Ò°  u¡Ø€Mr   c                 ó&   — ddl m}  || ||||«      S )a  Return a GeodesicLine object

    :param lat1: latitude of the first point in degrees
    :param lon1: longitude of the first point in degrees
    :param azi1: azimuth at the first point in degrees
    :param caps: the :ref:`capabilities <outmask>`
    :return: a :class:`~geographiclib.geodesicline.GeodesicLine`

    This allows points along a geodesic starting at (*lat1*, *lon1*),
    with azimuth *azi1* to be found.  The default value of *caps* is
    STANDARD | DISTANCE_IN, allowing direct geodesic problem to be
    solved.

    r   rG  )rI  rH  )r‹   r  r  r=  ÚcapsrH  s         r   ÚLinezGeodesic.Lineq  s   € õ$ 8Ù˜˜d D¨$°Ó5Ð5r   c                 ó    — ddl m} |s|t        j                  z  } || ||||«      }|r|j	                  |«       |S |j                  |«       |S )z#Private: general form of DirectLiner   rG  )rI  rH  r   rJ  ÚSetArcÚSetDistance)	r‹   r  r  r=  rL  rM  rW  rH  rN  s	            r   Ú_GenDirectLinezGeodesic._GenDirectLine†  sV   € õ 8á�DœH×0Ñ0Ñ0�DÙ˜˜d D¨$°Ó5€DÙØ
‡k�k�'Ôð €Kð ×Ñ�wÔØ€Kr   c                 ó.   — | j                  |||d||«      S )aÆ  Define a GeodesicLine object in terms of the direct geodesic
    problem specified in terms of spherical arc length

    :param lat1: latitude of the first point in degrees
    :param lon1: longitude of the first point in degrees
    :param azi1: azimuth at the first point in degrees
    :param s12: the distance from the first point to the second in
      meters
    :param caps: the :ref:`capabilities <outmask>`
    :return: a :class:`~geographiclib.geodesicline.GeodesicLine`

    This function sets point 3 of the GeodesicLine to correspond to
    point 2 of the direct geodesic problem.  The default value of *caps*
    is STANDARD | DISTANCE_IN, allowing direct geodesic problem to be
    solved.

    F©r\  )r‹   r  r  r=  r  rW  s         r   Ú
DirectLinezGeodesic.DirectLine”  s   € ð* ×Ñ˜t T¨4°¸¸TÓBÐBr   c                 ó.   — | j                  |||d||«      S )aÏ  Define a GeodesicLine object in terms of the direct geodesic
    problem specified in terms of spherical arc length

    :param lat1: latitude of the first point in degrees
    :param lon1: longitude of the first point in degrees
    :param azi1: azimuth at the first point in degrees
    :param a12: spherical arc length from the first point to the second
      in degrees
    :param caps: the :ref:`capabilities <outmask>`
    :return: a :class:`~geographiclib.geodesicline.GeodesicLine`

    This function sets point 3 of the GeodesicLine to correspond to
    point 2 of the direct geodesic problem.  The default value of *caps*
    is STANDARD | DISTANCE_IN, allowing direct geodesic problem to be
    solved.

    Tr^  )r‹   r  r  r=  r  rW  s         r   ÚArcDirectLinezGeodesic.ArcDirectLine«  s   € ð* ×Ñ˜t T¨4°°s¸DÓAÐAr   c           
      ó*  — ddl m} | j                  ||||d«      \
  }}}	}
}}}}}}t        j                  |	|
«      }|t
        j                  t
        j                  z  z  r|t
        j                  z  } || |||||	|
«      }|j                  |«       |S )a„  Define a GeodesicLine object in terms of the invese geodesic problem

    :param lat1: latitude of the first point in degrees
    :param lon1: longitude of the first point in degrees
    :param lat2: latitude of the second point in degrees
    :param lon2: longitude of the second point in degrees
    :param caps: the :ref:`capabilities <outmask>`
    :return: a :class:`~geographiclib.geodesicline.GeodesicLine`

    This function sets point 3 of the GeodesicLine to correspond to
    point 2 of the inverse geodesic problem.  The default value of *caps*
    is STANDARD | DISTANCE_IN, allowing direct geodesic problem to be
    solved.

    r   rG  )
rI  rH  r;  r   rB  r   r®   rJ  r°   rZ  )r‹   r  r  r  r  rW  rH  r  Ú_rå   ræ   r=  rN  s                r   ÚInverseLinezGeodesic.InverseLineÂ  s—   € õ& 8Ø-1×-=Ñ-=Ø
ˆD�$˜˜aó.!Ñ*€CˆˆE�5˜!˜Q  1 a¨ä�;‰;�u˜eÓ$€DØŒx× Ñ ¤8×#7Ñ#7Ñ7Ò8Ø
Œh×ÑÑ€dÙ˜˜d D¨$°°e¸UÓC€DØ‡K�K�ÔØ€Kr   c                 ó    — ddl m}  || |«      S )z¾Return a PolygonArea object

    :param polyline: if True then the object describes a polyline
      instead of a polygon
    :return: a :class:`~geographiclib.polygonarea.PolygonArea`

    r   )ÚPolygonArea)Úgeographiclib.polygonarearf  )r‹   Úpolylinerf  s      r   ÚPolygonzGeodesic.Polygonß  s   € õ 6Ù�t˜XÓ&Ð&r   N)F)SÚ__name__Ú
__module__Ú__qualname__Ú__doc__ÚGEOGRAPHICLIB_GEODESIC_ORDERr9   rP   r]   r`   rj   r’   r‚   r˜   r„   r¤   r†   r  ÚsysÚ
float_infoÚmant_digr  r    r!   r}   rò   Úepsilonr  rÓ   r{   r  rÔ   r   ÚCAP_NONEÚCAP_C1ÚCAP_C1pÚCAP_C2ÚCAP_C3ÚCAP_C4ÚCAP_ALLÚCAP_MASKÚOUT_ALLr®   Ústaticmethodr   r5   r@   rV   r^   ra   rk   rŒ   rˆ   r‰   rŠ   r¦   rª   r¬   rË   rð   r  r;  ÚSTANDARDrE  rO  rS  rU  rJ  rX  r\  r_  ra  rd  ri  r  rQ  rR  rA  r°   r±   r²   r  ÚALLr?  © r   r   r   r   V   s�  „ Ùà!"ÐØ	%€$Ø	%€$Ø
&€%Ø	%€$Ø	%€$Ø	%€$Ø
€%Ø	%€$Ø�4˜!‘8Ñ Ñ
"€%Ø	%€$Ø�4˜!‘8Ñ Ñ
"€%Ø€'Ø�c—n‘n×-Ñ-Ñ-°Ñ2€'à
ˆ$�)‰)�C—N‘N×&Ñ&Ó
'€%Ø
�.‰.×
 Ñ
 €%Ø
�‰+€%Ø
ˆ$�)‰)�EÓ
€%Ø
�%‰-€%Ø�E‰\€(à×(Ñ(€(Ø×&Ñ&€&Ø×'Ñ'€'Ø×&Ñ&€&Ø×&Ñ&€&Ø×&Ñ&€&Ø×'Ñ'€'Ø×(Ñ(€(Ø×'Ñ'€'Ø×(Ñ(€(àñ%ó ð%ð2 ñ,ó ð,ð\ ñ!ó ð!ð ñó ðð& ñó ðð& ñ!ó ð!ð ñó ðò&.ò`ò"ò6òB>ò

ò
ò3$òlH2òXJòZuDðp	 +×3Ñ3ó(òV8ð *×2Ñ2ó#ðL -×5Ñ5ó#ðL %×-Ñ-Ø×)Ñ)ñ*ó6ð, /×7Ñ7Ø'×3Ñ3ñ4óð +×3Ñ3Ø#×/Ñ/ñ0óCð0 +×3Ñ3Ø#×/Ñ/ñ0óBð0 ,×4Ñ4Ø$×0Ñ0ñ1óó:
'ð %×*Ñ*€%Ø#Ø$×-Ñ-€(Ø"Ø$×.Ñ.€)Ø#Ø$×,Ñ,€'Ø-Ø$×-Ñ-€(Ø!Ø$×-Ñ-€(ØØ$×0Ñ0€+ðà$×2Ñ2€-Ø'Ø$×2Ñ2€-Ø2Ø$×)Ñ)€$ØØ$×(Ñ(€#ØØ$×0Ñ0€+ðr   r   )rm  r    ro  Úgeographiclib.geomathr   Úgeographiclib.constantsr   Ú geographiclib.geodesiccapabilityr   r   ÚWGS84_aÚWGS84_fÚWGS84r  r   r   ú<module>r†     sH   ðñ;ó^ Û 
Ý &Ý -Ý ?÷pñ pñd% ˜)×+Ñ+¨Y×->Ñ->Ó?€„Ø +r   