U
    7h                     @   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                   @   st  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jIZIejJZJejKZKejLZLejMZMej=Z=ejBZBejNZNejOZOejPZPejQZQejRZRdBS )DGeodesiczSolve geodesic problems            
      i  c           	      C   s   t |}||  }d||  ||  }d}|d@ rB|d8 }|| }nd}|d }|r|d8 }|d8 }|| | ||  }|d8 }|| | ||  }qN| rd| | | S |||  S )z9Private: Evaluate a trig series using Clenshaw summation.r   r   r   )len)	ZsinpZsinxZcosxcknary1Zy0 r   P/var/www/formularioweb/env/lib/python3.8/site-packages/geographiclib/geodesic.py_SinCosSeriesz   s$     
  
zGeodesic._SinCosSeriesc                 C   s^  t | }t |}|| d d }|dkr6|dksV|| d }t |}|| }||d|   }|}	|dkr|| }
|
|
dk rt| nt|7 }
t |
}|	||dkr|| nd 7 }	n4tt| ||  }|	d| t|d  7 }	tt |	| }|	dk r |||	  n|	| }|| d|  }|t|t | |  }nd}|S )z Private: solve astroid equation.r   r   r      r      )r   sqmathsqrtZcbrtatan2cos)xypqrSr2Zr3ZdiscuZT3TangvZuvwr   r   r   r   _Astroid   s,    


"
zGeodesic._Astroidc                 C   sJ   dddddg}t jd }t||dt| ||d   }||  d|   S )zPrivate: return A1-1.r   r   @   r      r   )r   nA1_r   polyvalr   epscoeffmtr   r   r   _A1m1f   s        
"zGeodesic._A1m1fc                 C   s   ddddddddd	dd
dddddddg}t | }| }d}tdtjd D ]N}tj| d }|t |||| ||| d   ||< ||d 7 }|| 9 }qJdS )zPrivate: return C1.r   i    r)      	      r      i   r   r   r   N)r   r   ranger   nC1_r,   r.   r   r/   Zeps2dolr0   r   r   r   _C1f   s6                
(zGeodesic._C1fc                 C   s   ddddddddd	d
ddddddddg}t | }| }d}tdtjd D ]N}tj| d }|t |||| ||| d   ||< ||d 7 }|| 9 }qJdS )zPrivate: return C1'   iPr9   i   i  ii   i 0  it     ii
  i   i  i  i   r   r   r   N)r   r   r=   r   nC1p_r,   r?   r   r   r   _C1pf   s6                
(zGeodesic._C1pfc                 C   sJ   dddddg}t jd }t||dt| ||d   }||  d|   S )zPrivate: return A2-1iii@r   r*   r   r   )r   nA2_r   r,   r   r-   r   r   r   _A2m1f   s        
"zGeodesic._A2m1fc                 C   s   ddddddddd	d
ddddddddg}t | }| }d}tdtjd D ]N}tj| d }|t |||| ||| d   ||< ||d 7 }|| 9 }qJdS )zPrivate: return C2r   r      r4   #   r)   rF   r7      P   r9      r;   ?   r<   M   r   N)r   r   r=   r   nC2_r,   r?   r   r   r   _C2f   s6                
(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rdn>| jdkrt
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s.tdt
| j	rH| j	dksPt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listr=   nA3x__A3xnC3x__C3xnC4x__C4x_A3coeff_C3coeff_C4coeff)selfrW   rX   r   r   r   __init__  s>    


zGeodesic.__init__c                 C   s   dddddddddddddd	dd
d	d	g}d}d}t tjd	 ddD ]T}ttj| d	 |}t|||| j||| d	   | j|< |d	7 }||d
 7 }qBdS )z#Private: return coefficients for A3   r)   r3   rK   r      r   r   r   N)r=   r   nA3_rd   r   r,   r\   rj   )rr   r/   rA   r   jr0   r   r   r   ro   C  s4                 (zGeodesic._A3coeffc              -   C   s   ddddddddddddd	ddd
dddddddddddddddddddddddddddddg-}d}d}t dtjD ]p}t tjd |d dD ]T}ttj| d |}t|||| j||| d   | j|< |d7 }||d 7 }qqrdS )z#Private: return coefficients for C3r   ru   r      r3   r)   r   r   rw   r   r*   rt   rv   r4   rO   r;   ir8   rF   r5      i   i 
  N)r=   r   nC3_rd   r   r,   r\   rl   rr   r/   rA   r   rB   ry   r0   r   r   r   rp   T  sl                                   (zGeodesic._C3coeffc              M   C   s   dddddddddd	d
ddddddddddddddddddddddddddd d!d"dd#d$d%d&d'dd(d)d*d+d,d-d.d/d,d0d1dd2d,d3d4d5d6d7d8d9d:d;d<dd=d>d?d@dAgM}dB}dB}t tjD ]j}t tjd |d dCD ]N}tj| d }t|||| j||| d   | j|< |d7 }||dD 7 }qqdES )Fz#Private: return coefficients for C4a   i:  i@     i  i iPi%  i`i@7  i ir)   ip  i  iEd      i<  ih  iiNu  r   i1#  ii  i i  i  ii@  ii#  iiii  i0i  rw   i)  i@  iXio i i  ii`i@  i  ixiW  i   i0i i   i ix  i r6   i i@  i/ ru   i r   r3   r   N)r=   r   nC4_r   r,   r\   rn   r~   r   r   r   rq   o  s                                                             (zGeodesic._C4coeffc                 C   s   t tjd | jd|S )zPrivate: return A3r   r   )r   r,   r   rx   rj   )rr   r.   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)r=   r   r}   r   r,   rl   rr   r.   r   ZmultrA   rB   r0   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)r=   r   r   r   r,   rn   r   r   r   r   _C4f  s    zGeodesic._C4fc                 C   s,  |t jM }tj } } } }}|t jt jB t jB @ rt |}t || |t jt jB @ rt 	|}t 
|| || }d| }d| }|t j@ rt d|||t d||| }|||  }|t jt jB @ rxt d|||t d||| }|| || ||   }nj|t jt jB @ rxt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GEODESICSCALEr2   rC   rJ   rS   r   r=   rR   r[   )rr   r.   sig12ssig1csig1dn1ssig2csig2dn2cbet1cbet2outmaskC1aC2aZs12bm12bm0M12M21A1A2Zm0xZB1ZB2ZJ12rB   csig12r1   r   r   r   _Lengths  sP    


 
zGeodesic._Lengthsc           *      C   s8  d}t j } }}|| ||  }|| ||  }|| }||| 7 }|dko`|dk o`|| dk }|rt|| }||t||   }t d| j|  }|| j|  }t |}t |}n|}|	}|| }|dkr||| t| d|   n||| t| d|   }t 	||}|| || |  }|r|| j
k r|| }||| |dkrtt|d|  nd|   }t||\}}t ||}ndt| 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 }|| } || }!||  }"n|| ||  }#t ||#}$| | jt j|$ || ||||||tj|
|\}%}&}'}%}%d|&|| |' t j   }!|!dk r||! n| j t| t j } | | }|| }"|"tj kr|!dtj kr| jdkrVtd	|! }t dt|  }n0t|!tj krjd
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.r3   r   g      ?r   rT   r   r   g{GzrU                 )r   r   r   r   r   r[   rY   sinr   hypotre   normr   r`   r\   pirX   r   r   r   r   tol1_xthresh_rd   rc   r(   )*rr   sbet1r   r   sbet2r   r   lam12slam12clam12r   r   r   salp2calp2dnmZsbet12Zcbet12Zsbet12aZ	shortlineZsbetm2omg12somg12comg12salp1calp1Zssig12r   Zlam12xk2r.   ZlamscaleZbetscaler   r   Zcbet12aZbet12adummyr   r   r   Zomg12ar   r   r   _InverseStart  s     
  & 
            $ 
 
 zGeodesic._InverseStartc           &      C   sv  |dkr|dkrt j }|| }t||| }|}|| }||  }}t||\}}||krh|| n|}||kst|| krtt|| || k r|| ||  n|| ||   | nt|}|}|| }||  }}t||\}}t	t
d|| ||  d || ||  }t
d|| ||  d }|| ||  }t	||
 ||	  ||
 ||	  }t|| j }|ddtd|   |  } | | | t d|||t d||| }!| j | |  | ||!  }"||" }#|rV|dkrd| j | | }$n@| | |||||||||t j||\}%}$}%}%}%|$| j||  9 }$ntj}$|#|||||||| |"|$fS )zPrivate: Solve hybrid problemr   r   r   r   Trv   )r   tiny_r   r   r   r   r`   r   r   r   rc   r[   r   r   rX   r   rY   r   r   r   )&rr   r   r   r   r   r   r   r   r   Zslam120Zclam120Zdiffpr   r   C3asalp0calp0r   Zsomg1r   Zcomg1r   r   r   Zsomg2r   Zcomg2r   r   r   etar   r.   ZB312domg12r   Zdlam12r   r   r   r   	_Lambda12p  s      
            zGeodesic._Lambda12c           L      C   s	  t j } } } }	 }
}|tjM }t||\}}t d|}|| }|| }t |}t||\}}d| | }t	t
|}t	t
|}t|t|k st |rdnd}|dk r|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 s|(dkr|&dtj k s|&tjk r|'dk s|(dk rd }& }(}'|(| j 9 }(|'| j 9 }'t !|&}nd	}d
}*d}+d},|s|dkr| j"dksJ|| j"d krd }} d }}!| j#| }'|| j  }&},| j t $|& }(|tj%@ rt &|& }	}
|| j }nH|s| '|||||||||||\}&}}}!} }-|&dkrJ|&| j  |- }'t|-| j  t $|&|-  }(|tj%@ r.t &|&|-  }	}
t !|&}|| j|-  },nd}.d	 }/}0tj}1d}2tj}3d}4|.tj(k rF| )|||||||||||.tj*k |||\}5}!} }&}"}#}$}%}6}7}8|0sFt|5|/rdndtj ksސqF|5dkr|.tj*ks|| |4|3 kr|}3|}4n0|5dk r@|.tj*ks8|| |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}/qj|1|3 d }|2|4 d }t||\}}d	}/t|1| |2|  tj,k p@t||3 ||4  tj,k }0qj||tjtj%B @ r`tjntj-B }=| |6|&|"|#||$|%||||=||\}'}(})}	}
|(| j 9 }(|'| j 9 }'t !|&}|tj.@ rt $|7}>t &|7}?||? ||>  }*||? ||>  }+|tj@ rd|' }|tj@ rd|( }|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}|sB|*d
krBt $|,}*t &|,}+|s|+dkr|| dk rd|+ }7d| }Gd| }Hdt |*||H ||G   |7|| |G|H    }InN|!| | |  }J| | |!|  }K|Jdkr|Kdk rtj| }Jd}Kt |J|K}I|| j4|I 7 }||| | 9 }|d7 }|dk 	rR||! }!}||  } }|tj%@ 	rR|	|
 }
}	||| 9 }||| 9 }|!|| 9 }!| || 9 } |||||!| ||	|
|f
S )z/Private: General version of the inverse problemr      r3   r   irU   r   r   Fg       @r   rw   rK   r   g-g      ?)5r   r   r   r   r   AngDiffcopysignradiansZsincosdeZAngRoundLatFixr`   isnanZsincosdrY   r   rc   r   r   r[   r   rh   r=   r>   rR   r}   r   r   r\   r   r   tol0_r]   degreesrX   rW   r   r   r   r   maxit2_r   maxit1_r   tolb_EMPTYAREAr   rZ   r   r   r   ra   )Lrr   lat1lon1lat2lon2r   a12s12m12r   r   S12lon12Zlon12sZlonsignr   r   r   ZswappZlatsignr   r   r   r   r   r   r   r   r   Zmeridianr   r   r   r   r   r   r   r   r   Zs12xZm12xr   r   r   r   r   ZnumitZtripnZtripbZsalp1aZcalp1aZsalp1bZcalp1br&   r.   r   ZdvZdalp1Zsdalp1Zcdalp1Znsalp1Z
lengthmaskZsdomg12Zcdomg12r   r   r   ZA4ZC4aZB41ZB42Zdbet1Zdbet2Zalp12Zsalp12Zcalp12r   r   r   _GenInverse  s   
 
"
 
  
 

               

   
          

               $  

 
	
           



 
  
 

  




  zGeodesic._GenInversec              
   C   s  |  |||||\
}}}}	}
}}}}}|tjM }|tj@ rXt||\}}|| | }n
t|}t||tj@ rx|nt|t||d}||d< |tj@ r||d< |tj	@ rt
||	|d< t
|
||d< |tj@ r||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   )rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   eresultr   r   r   Inverse  s@        



 

   zGeodesic.Inversec           	      C   s8   ddl m} |s|tjO }|| ||||}||||S )z*Private: General version of direct problemr   GeodesicLine)geographiclib.geodesicliner   r   DISTANCE_INZ_GenPosition)	rr   r   r   r   arcmodes12_a12r   r   liner   r   r   
_GenDirect  s
     
zGeodesic._GenDirectc              	   C   s   |  |||d||\	}}}}	}}
}}}|tjM }t||tj@ rF|nt|t||d}||d< |tj@ rx||d< |tj@ r||d< |tj	@ r|	|d< |tj
@ r|
|d< |tj@ r||d< ||d	< |tj@ 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   )r   r   r   r   r   r   r   LATITUDE	LONGITUDEr   r   r   r   )rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Direct'  s<         

 
 
 
 
 
 zGeodesic.Directc              	   C   s   |  |||d||\	}}}}}	}
}}}|tjM }t||tj@ rF|nt|t||d}|tj@ rp|	|d< |tj@ r||d< |tj	@ r||d< |tj
@ r||d< |tj@ r|
|d< |tj@ r||d< ||d	< |tj@ 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   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   )rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   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   r   )r   r   )rr   r   r   r   capsr   r   r   r   Lineq  s    zGeodesic.Linec           	      C   sH   ddl m} |s|tjO }|| ||||}|r:|| n
|| |S )z#Private: general form of DirectLiner   r   )r   r   r   r   SetArcZSetDistance)	rr   r   r   r   r   r   r   r   r   r   r   r   _GenDirectLine  s     

zGeodesic._GenDirectLinec                 C   s   |  |||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   )rr   r   r   r   r   r   r   r   r   
DirectLine  s    zGeodesic.DirectLinec                 C   s   |  |||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   )rr   r   r   r   r   r   r   r   r   ArcDirectLine  s    zGeodesic.ArcDirectLinec              
   C   sz   ddl m} | ||||d\
}}}	}
}}}}}}t|	|
}|tjtj@ @ rX|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   r   )
r   r   r   r   r   r   r   r   r   r   )rr   r   r   r   r   r   r   r   _r   r   r   r   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)Zgeographiclib.polygonarear   )rr   Zpolyliner   r   r   r   Polygon  s    	zGeodesic.PolygonN)F)S__name__
__module____qualname____doc__ZGEOGRAPHICLIB_GEODESIC_ORDERr+   r>   rG   rI   rR   rx   ri   r}   rk   r   rm   r   sys
float_infomant_digr   r   r   rd   r   epsilonr   r   rb   r   r   r   ZCAP_NONEZCAP_C1ZCAP_C1pZCAP_C2ZCAP_C3ZCAP_C4ZCAP_ALLZCAP_MASKZOUT_ALLr   staticmethodr   r(   r2   rC   rH   rJ   rS   rs   ro   rp   rq   r   r   r   r   r   r   r   STANDARDr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ZALLr   r   r   r   r   r   V   s   


.
	


	
0!6 M  :
+	
&
&





r   )r   r   r   Zgeographiclib.geomathr   Zgeographiclib.constantsr   Z geographiclib.geodesiccapabilityr   r   ZWGS84_aZWGS84_fZWGS84r   r   r   r   <module>   s"   O         ;