o
    2c                     @   sZ   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 dZ	e	ej
eje	_dS )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                   @   s  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  d ZeZeed  d ZdZeejj d ZeejjZejjZde ZeeZee Zde Zej Z ej!Z!ej"Z"ej#Z#ej$Z$ej%Z%ej&Z&ej'Z'ej(Z(ej)Z)e*d	d
 Z+e*dd Z,e*dd Z-e*dd Z.e*dd Z/e*dd Z0e*dd Z1dd Z2dd Z3dd Z4dd Z5dd  Z6d!d" Z7d#d$ Z8d%d& Z9d'd( Z:d)d* Z;d+d, Z<ej=fd-d.Z>d/d0 Z?ej=fd1d2Z@ej=fd3d4ZAej=ejBB fd5d6ZCej=ejBB fd7d8ZDej=ejBB fd9d:ZEej=ejBB fd;d<ZFej=ejBB fd=d>ZGdCd@dAZHejIZI	 ejJZJ	 ejKZK	 ejLZL	 ejMZM	 ej=Z=	 ejBZB	 ejNZN	 ejOZO	 ejPZP	 ejQZQ	 ejRZRdBS )DGeodesiczSolve geodesic problems            
      i  c           	      C   s   t |}||  }d||  ||  }d}|d@ r!|d8 }|| }nd}|d }|rK|d8 }|d8 }|| | ||  }|d8 }|| | ||  }|s)| rUd| | | S |||  S )z9Private: Evaluate a trig series using Clenshaw summation.r   r   r   )len)	sinpsinxcosxcknary1y0 r   L/var/www/html/gps/gps/lib/python3.10/site-packages/geographiclib/geodesic.py_SinCosSeriesz   s    
zGeodesic._SinCosSeriesc                 C   s\  t | }t |}|| d d }|dkr|dks|| d }t |}|| }||d|   }|}	|dkr`|| }
|
|
dk rFt| nt|7 }
t |
}|	||dkr[|| nd 7 }	ntt| ||  }|	d| t|d  7 }	tt |	| }|	dk r|||	  n|	| }|| d|  }|t|t | |  }|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   r   r   r   _Astroid   s.   


"
zGeodesic._Astroidc                 C   sD   g d}t jd }t||dt| ||d   }||  d|   S )zPrivate: return A1-1.)r   r   @   r      r   r   r   )r   nA1_r   polyvalr   epscoeffmtr   r   r   _A1m1f      
"zGeodesic._A1m1fc                 C   ~   g d}t | }| }d}tdtjd D ]'}tj| d }|t |||| ||| d   ||< ||d 7 }|| 9 }qdS )zPrivate: return C1.)r       r2      	   r?      r         rH   rC   r   r   r   N)r   r   ranger   nC1_r5   r7   r   r8   eps2dolr9   r   r   r   _C1f      
(
zGeodesic._C1fc                 C   r=   )zPrivate: return C1')   iPrE   i   i  ii   i 0  it     ii
     i  rV   i  i   r   r   r   N)r   r   rJ   r   nC1p_r5   rL   r   r   r   _C1pf   rR   zGeodesic._C1pfc                 C   sD   g d}t jd }t||dt| ||d   }||  d|   S )zPrivate: return A2-1)iii@r   r3   r   r   r   )r   nA2_r   r5   r   r6   r   r   r   _A2m1f   r<   zGeodesic._A2m1fc                 C   r=   )zPrivate: return C2)r   r      r@   #   r2   rU   rC      P   rE      r\   rG   ?   rI   M   rC   r   r   r   N)r   r   rJ   r   nC2_r5   rL   r   r   r   _C2f   rR   zGeodesic._C2fc              	   C   s  t || _	 t || _	 d| j | _| jd| j  | _| jt| j | _| jd| j  | _| j| j | _	t| jt| j	| jdkrFdn| jdkrTt
t
| jn	t
t
| j t
t| j   d | _dtj t
tdt| jtdd| jd   d  | _t
| jr| jdkstdt
| j	r| j	dkstdtttj| _tttj| _tttj| _|   |    | !  d	S )
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   皙?gMbP?      ?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listrJ   nA3x__A3xnC3x__C3xnC4x__C4x_A3coeff_C3coeff_C4coeff)selfrg   rh   r   r   r   __init__  sB   


zGeodesic.__init__c                 C   s|   g d}d}d}t tjd ddD ]*}ttj| d |}t|||| j||| d   | j|< |d7 }||d 7 }qdS )z#Private: return coefficients for A3)   r   r2   r>   r   r>   r[   r   r>   r      r   r>   r   r   r   r   r   r>   r   N)rJ   r   nA3_rt   r   r5   rl   rz   )r   r8   rO   r   jr9   r   r   r   r   C  s   (zGeodesic._A3coeffc                 C   s   g d}d}d}t dtjD ]8}t tjd |d dD ]*}ttj| d |}t|||| j||| d   | j|< |d7 }||d 7 }qqdS )z#Private: return coefficients for C3)-r   r   r      r   r>   r   r   r2   r>   r   r   r   r>   r   r   r   r3   r   r   r   r   r   r   r2   r   r   r   r@   r_   rG   irD   rU   r   rA   r      r_   rG   ir_   rG      i 
  r   r   r>   r   N)rJ   r   nC3_rt   r   r5   rl   r|   r   r8   rO   r   rP   r   r9   r   r   r   r   T  s   (zGeodesic._C3coeffc                 C   s   g d}d}d}t tjD ]5}t tjd |d dD ]'}tj| d }t|||| j||| d   | j|< |d7 }||d 7 }qqdS )z#Private: return coefficients for C4)Ma   :  i@       i iPi%  r   i`i@7   ir   r2   ip  r   i  iEr   d      i<  ih  iiNu  r   r   i1#  ii   i  i  ir   i@  ii#  ir   iii  i0i  r   r   i)  i@  iXo i i  ir   i`i@  r   i  r   ixiW  i   i0i i   i ix  i rB   r   i i@  i/ r   i r   r   r>   r   N)rJ   r   nC4_r   r5   rl   r~   r   r   r   r   r   o  s   (zGeodesic._C4coeffc                 C   s   t tjd | jd|S )zPrivate: return A3r   r   )r   r5   r   r   rz   )r   r7   r   r   r   _A3f  s   zGeodesic._A3fc                 C   sZ   d}d}t dtjD ] }tj| d }||9 }|t|| j|| ||< ||d 7 }q
dS )zPrivate: return C3r   r   N)rJ   r   r   r   r5   r|   r   r7   r   multrO   rP   r9   r   r   r   _C3f  s   zGeodesic._C3fc                 C   sX   d}d}t tjD ] }tj| d }|t|| j|| ||< ||d 7 }||9 }q	dS )zPrivate: return C4r   r   N)rJ   r   r   r   r5   r~   r   r   r   r   _C4f  s   
zGeodesic._C4fc                 C   s"  |t jM }tj } } } }}|t jt jB t jB @ rEt |}t || |t jt jB @ rAt 	|}t 
|| || }d| }d| }|t j@ rt d|||t d||| }|||  }|t jt jB @ rt d|||t d||| }|| || ||   }n3|t jt jB @ rtdt jD ]}|||  |||   ||< q|| t d|||t d|||  }|t j@ r|}|||  |||   || |  }|t j@ r
|| ||  }| j|	|
  |	|
  ||  }||| ||  | |  }||| ||  | |  }|||||fS )z"Private: return a bunch of lengthsr   T)r   OUT_MASKr   nanDISTANCEREDUCEDLENGTHGEODESICSCALEr;   rQ   rZ   rc   r   rJ   rb   rk   )r   r7   sig12ssig1csig1dn1ssig2csig2dn2cbet1cbet2outmaskC1aC2as12bm12bm0M12M21A1A2m0xB1B2J12rP   csig12r:   r   r   r   _Lengths  sR   





zGeodesic._Lengthsc           *      C   s,  d}t j } }}|| ||  }|| ||  }|| }||| 7 }|dko0|dk o0|| dk }|rat|| }||t||   }t d| j|  }|| j|  }t |}t |}n|}|	}|| }|dkr|||| t| d|   n||| t| d|   }t 	||}|| || |  }|r|| j
k r|| }||| |dkrt|d|  nd|   }t||\}}t ||}n/t| jdks|dks|dt| j t j t| krnt | |	 }| jdkr*t|| j }|ddt d|   |  }| j| | | t j }|| } || }!||  }"nT|| ||  }#t ||#}$| | jt j|$ || ||||||tj|
|\}%}&}'}%}%d|&|| |' t j   }!|!dk rj||! n| j t| t j } | | }|| }"|"tj kr|!dtj kr| jdkrtd	|! }t dt|  }nWt|!tj krd
nd|!}t dt| }n>t|!|"}(|| jdkr|! |( d|(  n|" d|(  |(  })t |)}t |) }|| }||| t| d|   }|dks
t||\}}nd}d}||||||fS )z3Private: Find a starting value for Newton's method.r>   r   g      ?r   rd   r   r   g{Gzre                 )r   r   r   r   r   rk   ri   sinr    hypotru   normr   rp   rl   pirh   r   r   r   r   tol1_xthresh_rt   rs   r1   )*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k2r7   lamscalebetscaler!   r"   cbet12abet12adummyr   r   r   omg12ar   r   r   _InverseStart  s   & 
$$ 
zGeodesic._InverseStartc           &      C   sv  |dkr|dkrt j }|| }t||| }|}|| }||  }}t||\}}||kr4|| n|}||ksAt|| krbtt|| || k rV|| ||  n|| ||   | nt|}|}|| }||  }}t||\}}t	t
d|| ||  d || ||  }t
d|| ||  d }|| ||  }t	||
 ||	  ||
 ||	  }t|| j }|ddtd|   |  } | | | t d|||t d||| }!| j | |  | ||!  }"||" }#|r+|dkr
d| j | | }$n$| | |||||||||t j||\}%}$}%}%}%|$| j||  9 }$ntj}$|#|||||||| |"|$fS )zPrivate: Solve hybrid problemr   r   r   r   Tr   )r   tiny_r   r   r   r   rp   r   r   r   rs   rk   r   r   rh   r   ri   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   r7   B312domg12r   dlam12r   r   r   r   	_Lambda12p  sd   
zGeodesic._Lambda12c           L      C   s	  t j } } } }	 }
}|tjM }t||\}}t d|}|| }|| }t |}t||\}}d| | }t	t
|}t	t
|}t|t|k sXt |rZdnd}|dk ri|d9 }||}}t d| }||9 }||9 }t|\}}|| j9 }t||\}}ttj|}t|\}}|| j9 }t||\}}ttj|}|| k r||krt ||}n	t|| kr|}t d| jt|  }t d| jt|  }tttjd }tttjd }tttj}|dkp|dk}|r|}|}d} d}!|}"|| }#|}$| | }%t td|#|$ |"|%  d |#|% |"|$  }&| | j|&|"|#||$|%||||tjB tjB ||\}'}(})}	}
|&dk sU|(dkr|&dtj k sm|&tjk rs|'dk sm|(dk rsd }& }(}'|(| j 9 }(|'| j 9 }'t !|&}nd	}d
}*d}+d},|s|dkr| j"dks|| j"d krd }} d }}!| j#| }'|| j  }&},| j t $|& }(|tj%@ rt &|& }	}
|| j }n|sx| '|||||||||||\}&}}}!} }-|&dkr!|&| j  |- }'t|-| j  t $|&|-  }(|tj%@ rt &|&|-  }	}
t !|&}|| j|-  },nWd}.d	 }/}0tj}1d}2tj}3d}4|.tj(k r"| )|||||||||||.tj*k |||\}5}!} }&}"}#}$}%}6}7}8|0sit|5|/rbdndtj ksjn|5dkr|.tj*ks~|| |4|3 kr|}3|}4n|5dk r|.tj*ks|| |2|1 k r|}1|}2|.d7 }.|.tj*k r|8dkr|5 |8 }9t $|9}:t &|9};||; ||:  }<|<dkrt|9t j+k r||; ||:  }|<}t||\}}t|5dtj k}/q1|1|3 d }|2|4 d }t||\}}d	}/t|1| |2|  tj,k pt||3 ||4  tj,k }0|.tj(k s7||tjtj%B @ r/tjntj-B }=| |6|&|"|#||$|%||||=||\}'}(})}	}
|(| j 9 }(|'| j 9 }'t !|&}|tj.@ rxt $|7}>t &|7}?||? ||>  }*||? ||>  }+|tj@ rd|' }|tj@ rd|( }|tj.@ r|| }@t /||| }A|Adkr|@dkr|}"|| }#|}$| | }%t|A| j }B|Bddt d|B   |B  }6t| j#|A |@ | j0 }Ct|"|#\}"}#t|$|%\}$}%tttj1}D| 2|6|D t3d	|"|#|D}Et3d	|$|%|D}F|C|F|E  }nd}|s |*d
kr t $|,}*t &|,}+|sT|+dkrT|| dk rTd|+ }7d| }Gd| }Hdt |*||H ||G   |7|| |G|H    }In'|!| | |  }J| | |!|  }K|Jdkru|Kdk rutj| }Jd}Kt |J|K}I|| j4|I 7 }||| | 9 }|d7 }|dk r||!}!}|| } }|tj%@ r|	|
}
}	||| 9 }||| 9 }|!|| 9 }!| || 9 } |||||!| ||	|
|f
S )z/Private: General version of the inverse problemr      r>   r   ire   r   r   Fg       @r   r   r[   r   g-g      ?)5r   r   r   r   r   AngDiffcopysignradianssincosdeAngRoundLatFixrp   isnansincosdri   r   rs   r   r   rk   r   rx   rJ   rK   rb   r   r   r   rl   r   r   tol0_rm   degreesrh   rg   r   r   r    r   maxit2_r   maxit1_r   tolb_EMPTYAREAr   rj   r   r   r   rq   )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calp1br.   r7   r   dvdalp1sdalp1cdalp1nsalp1
lengthmasksdomg12cdomg12r   r   r   A4C4aB41B42dbet1dbet2alp12salp12calp12r   r   r   _GenInverse  s  

"









$

	0









zGeodesic._GenInversec              
   C   s  |  |||||\
}}}}	}
}}}}}|tjM }|tj@ r,t||\}}|| | }nt|}t||tj@ r<|nt|t||d}||d< |tj@ rU||d< |tj	@ rjt
||	|d< t
|
||d< |tj@ rs||d< |tj@ r||d< ||d< |tj@ 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resultr   r   r   Inverse  s0   





zGeodesic.Inversec           	      C   s8   ddl m} |s|tjO }|| ||||}||||S )z*Private: General version of direct problemr   GeodesicLine)geographiclib.geodesicliner3  r   DISTANCE_IN_GenPosition)	r   r   r  r)  arcmodes12_a12r   r3  liner   r   r   
_GenDirect  s   zGeodesic._GenDirectc              	   C   s   |  |||d||\	}}}}	}}
}}}|tjM }t||tj@ r#|nt|t||d}||d< |tj@ r<||d< |tj@ rE||d< |tj	@ rN|	|d< |tj
@ rW|
|d< |tj@ rd||d< ||d	< |tj@ rm||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  )r:  r   r   r   r   r+  r,  LATITUDE	LONGITUDEr-  r   r   r   )r   r   r  r)  r  r   r  r  r  r*  r  r   r   r  r0  r   r   r   Direct'  s&   

zGeodesic.Directc              	   C   s   |  |||d||\	}}}}}	}
}}}|tjM }t||tj@ r#|nt|t||d}|tj@ r8|	|d< |tj@ rA||d< |tj	@ rJ||d< |tj
@ rS||d< |tj@ r\|
|d< |tj@ ri||d< ||d	< |tj@ rr||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  )r:  r   r   r   r   r+  r,  r   r;  r<  r-  r   r   r   )r   r   r  r)  r  r   r  r  r*  r  r  r   r   r  r0  r   r   r   	ArcDirectL  s&   

zGeodesic.ArcDirectc                 C   s   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   r2  )r4  r3  )r   r   r  r)  capsr3  r   r   r   Lineq  s   zGeodesic.Linec           	      C   sJ   ddl m} |s|tjO }|| ||||}|r|| |S || |S )z#Private: general form of DirectLiner   r2  )r4  r3  r   r5  SetArcSetDistance)	r   r   r  r)  r7  r8  r?  r3  r9  r   r   r   _GenDirectLine  s   

zGeodesic._GenDirectLinec                 C      |  |||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rC  )r   r   r  r)  r  r?  r   r   r   
DirectLine     zGeodesic.DirectLinec                 C   rD  )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.

    TrE  )r   r   r  r)  r  r?  r   r   r   ArcDirectLine  rG  zGeodesic.ArcDirectLinec              
   C   sz   ddl m} | ||||d\
}}}	}
}}}}}}t|	|
}|tjtj@ @ r,|tjO }|| |||||	|
}|	| |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   r2  )
r4  r3  r(  r   r.  r   r   r5  r   rA  )r   r   r  r  r  r?  r3  r  _r   r   r)  r9  r   r   r   InverseLine  s   


zGeodesic.InverseLineFc                 C   s   ddl m} || |S )zReturn 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.polygonarearK  )r   polylinerK  r   r   r   Polygon  s   	
zGeodesic.PolygonN)F)S__name__
__module____qualname____doc__GEOGRAPHICLIB_GEODESIC_ORDERr4   rK   rW   rY   rb   r   ry   r   r{   r   r}   r   sys
float_infomant_digr   r   r   rt   r   epsilonr   r   rr   r   r   r   CAP_NONECAP_C1CAP_C1pCAP_C2CAP_C3CAP_C4CAP_ALLCAP_MASKOUT_ALLr   staticmethodr   r1   r;   rQ   rX   rZ   rc   r   r   r   r   r   r   r   r   r   r   r(  STANDARDr1  r:  r=  r>  r5  r@  rC  rF  rH  rJ  rN  r   r;  r<  r-  r   r   r   r   ALLr+  r   r   r   r   r   V   s    


.
	


	
0!6 M  :
+	
&
&





r   )rR  r   rT  geographiclib.geomathr   geographiclib.constantsr    geographiclib.geodesiccapabilityr   r   WGS84_aWGS84_fWGS84r   r   r   r   <module>   s$    O         ;