o
    Ti                     @   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)	ZsinpZsinxZcosxcknary1Zy0 r   V/var/www/html/evchargy.com/venv/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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   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       r)      	   r6      r         r?   r:   r   r   r   N)r   r   ranger   nC1_r,   r.   r   r/   Zeps2dolr0   r   r   r   _C1f      
(
zGeodesic._C1fc                 C   r4   )zPrivate: return C1')   iPr<   i   i  ii   i 0  it     ii
     i  rL   i  i   r   r   r   N)r   r   rA   r   nC1p_r,   rC   r   r   r   _C1pf   rH   zGeodesic._C1pfc                 C   sD   g d}t jd }t||dt| ||d   }||  d|   S )zPrivate: return A2-1)iii@r   r*   r   r   r   )r   nA2_r   r,   r   r-   r   r   r   _A2m1f   r3   zGeodesic._A2m1fc                 C   r4   )zPrivate: return C2)r   r      r7   #   r)   rK   r:      P   r<      rR   r>   ?   r@   M   r:   r   r   r   N)r   r   rA   r   nC2_r,   rC   r   r   r   _C2f   rH   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listrA   nA3x__A3xnC3x__C3xnC4x__C4x_A3coeff_C3coeff_C4coeff)selfr]   r^   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)   rz   r)   r5   rz   r5   rQ   r   r5   r|      r   r5   r   r   r   r   r   r5   r   N)rA   r   nA3_rj   r   r,   rb   rp   )rx   r/   rE   r   jr0   r   r   r   ru   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{   r5   r   r   r)   r5   r   r   r}   r5   r   r   r   r*   r   r   r{   rz   r|   r   r)   r   rz   r   r7   rU   r>   ir;   rK   r   r8   r      rU   r>   irU   r>      i 
  r   r   r5   r   N)rA   r   nC3_rj   r   r,   rb   rr   rx   r/   rE   r   rF   r   r0   r   r   r   rv   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   r)   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 r9   r   i i@  i/ r{   i r   r   r5   r   N)rA   r   nC4_r   r,   rb   rt   r   r   r   r   rw   o  s   (zGeodesic._C4coeffc                 C   s   t tjd | jd|S )zPrivate: return A3r   r   )r   r,   r   r~   rp   )rx   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)rA   r   r   r   r,   rr   rx   r.   r   ZmultrE   rF   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)rA   r   r   r   r,   rt   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GEODESICSCALEr2   rG   rP   rY   r   rA   rX   ra   )rx   r.   sig12ssig1csig1dn1ssig2csig2dn2cbet1cbet2outmaskC1aC2aZs12bm12bm0M12M21A1A2Zm0xZB1ZB2ZJ12rF   csig12r1   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.r5   r   g      ?r   rZ   r   r   g{Gzr[                 )r   r   r   r   r   ra   r_   sinr   hypotrk   normr   rf   rb   pir^   r   r   r   r   tol1_xthresh_rj   ri   r(   )*rx   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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   rf   r   r   r   ri   ra   r   r   r^   r   r_   r   r   r   )&rx   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 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      r5   r   ir[   r   r   Fg       @r   r}   rQ   r   g-g      ?)5r   r   r   r   r   AngDiffcopysignradiansZsincosdeZAngRoundLatFixrf   isnanZsincosdr_   r   ri   r   r   ra   r   rn   rA   rB   rX   r   r   r   rb   r   r   tol0_rc   degreesr^   r]   r   r   r   r   maxit2_r   maxit1_r   tolb_EMPTYAREAr   r`   r   r   r   rg   )Lrx   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  sf  

"


 







$

	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   )rx   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.geodesicliner   r   DISTANCE_INZ_GenPosition)	rx   r   r   r   arcmodes12_a12r   r   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   )rx   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@ 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   )rx   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   )rx   r   r   r   capsr   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   r   )r   r   r   r   SetArcZSetDistance)	rx   r   r   r   r   r   r   r   r   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r   )rx   r   r   r   r   r   r   r   r   
DirectLine     zGeodesic.DirectLinec                 C   r   )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   )rx   r   r   r   r   r   r   r   r   ArcDirectLine  r   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   r   )
r   r   r   r   r   r   r   r   r   r   )rx   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  )rx   Zpolyliner  r   r   r   Polygon  s   	
zGeodesic.PolygonN)F)S__name__
__module____qualname____doc__ZGEOGRAPHICLIB_GEODESIC_ORDERr+   rB   rM   rO   rX   r~   ro   r   rq   r   rs   r   sys
float_infomant_digr   r   r   rj   r   epsilonr   r   rh   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   rG   rN   rP   rY   ry   ru   rv   rw   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         ;