KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux server112.speedpacket.com 3.10.0-962.3.2.lve1.5.36.el7.x86_64 #1 SMP Mon May 18 02:16:06 EDT 2020 x86_64
User : equistyl ( 1341)
PHP Version : 8.1.30
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/matplotlib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/matplotlib/bezier.pyo
�
r`]c@s5dZddlmZddlZddlmZddlmZddl	Z	de
fd��YZd�Zd	�Z
d
�Zd�Zdd
dd�Zdefd��YZdd�Zdd
dd�Zded�Zd�Zd�Zdd�Zd�Zd�Zd
ddd�Zd�Zd�ZdS(sO
A module providing some utility functions regarding bezier path manipulation.
i����(tprint_functionN(tPath(txortNonIntersectingPathExceptioncBseZRS((t__name__t
__module__(((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyR
scCs�||||}||||}	||}
}||}}
|
|
||}|dkrmtd��n|
|}}||
}}g||||gD]}||^q�\}}}}||||	}||||	}||fS(s� return a intersecting point between a line through (cx1, cy1)
    and having angle t1 and a line through (cx2, cy2) and angle t2.
    gsGiven lines do not intersect(t
ValueError(tcx1tcy1tcos_t1tsin_t1tcx2tcy2tcos_t2tsin_t2t	line1_rhst	line2_rhstatbtctdtad_bcta_tb_tc_td_tktxty((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pytget_intersections	5c
Cs�|dkr||||fS||}}||}}||||||}	}
||||||}}|	|
||fS(s�
    For a line passing through (*cx*, *cy*) and having a angle *t*, return
    locations of the two points located along its perpendicular line at the
    distance of *length*.
    g((
tcxtcytcos_ttsin_ttlengthR	R
R
Rtx1ty1tx2ty2((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pytget_normal_points2scCs"|d d||d|}|S(Ni����i((tbetattt	next_beta((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyt_de_casteljau1KscCs�tj|�}|g}x<trVt||�}|j|�t|�dkrPqqWg|D]}|d^q^}gt|�D]}|d^q�}||fS(s�split a bezier segment defined by its controlpoints *beta*
    into two separate segment divided at *t* and return their control points.

    iii����(tnptasarraytTrueR+tappendtlentreversed(R(R)t	beta_listt	left_betat
right_beta((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pytsplit_de_casteljauPs		
#gg�?g{�G�z�?cCs�||�}||�}||�}||�}t||�sNtd��nx�|d|dd|d|dd|dkr�||fSd||}	||	�}
||
�}t||�r�|	}|
}|}qQ|	}|
}|}qQdS(s$ Find a parameter t0 and t1 of the given bezier path which
    bounds the intersecting points with a provided closed
    path(*inside_closedpath*). Search starts from *t0* and *t1* and it
    uses a simple bisecting algorithm therefore one of the end point
    must be inside the path while the orther doesn't. The search stop
    when |t0-t1| gets smaller than the given tolerence.
    value for

    - bezier_point_at_t : a function which returns x, y coordinates at *t*

    - inside_closedpath : return True if the point is insed the path

    s4the segment does not seem to intersect with the pathiiig�?N(RR(tbezier_point_at_ttinside_closedpathtt0tt1t	tolerencetstarttendtstart_insidet
end_insidetmiddle_ttmiddlet
middle_inside((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyt*find_bezier_t_intersecting_with_closedpathcs*!
	t
BezierSegmentcBsqeZdZiejddg�d6ejdddg�d6ejddddg�d6Zd�Zd�ZRS(	s:
    A simple class of a 2-dimensional bezier segment
    g�?ig@ig@icCs�t|�}tj|�|_tj|d}tj|�}|dd�df}|dd�df}|||_|||_dS(s�
        *control_points* : location of contol points. It needs have a
         shpae of n * 2, where n is the order of the bezier line. 1<=
         n <= 3 is supported.
        iNi(	R0R,taranget_ordersRCt_binom_coeffR-t_pxt_py(tselftcontrol_pointst_ot_coefft_control_pointstxxtyy((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyt__init__�s
cCsutjd||j�ddd�}tj||j�}||}t||j�}t||j�}||fS(sevaluate a point at tg�?Ni����(R,tpowerREtsumRGRH(RIR)tone_minus_t_powerstt_powerstttt_xt_y((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyt
point_at_t�s&
(RRt__doc__R,tarrayRFRPRX(((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyRC�s	c	CsWt|�}|j}t||d|�\}}t|||d�\}}||fS(s�
    bezier : control points of the bezier segment
    inside_closedpath : a function which returns true if the point is inside
                        the path
    R:g@(RCRXRBR5(	tbezierR7R:tbzR6R8R9t_leftt_right((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyt)split_bezier_intersecting_with_closedpath�s
	c	sG|\������fd�}t||d|d|d|�dS(s�
    Find a radius r (centered at *xy*) between *rmin* and *rmax* at
    which it intersect with the path.

    inside_closedpath : function
    cx, cy : center
    cos_t, sin_t : cosine and sine for the angle
    rmin, rmax :
    cs�|��|�fS(N((tr(R RRR!(s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyt_f�sR8R9R:N(RB(R7txyR R!trmintrmaxR:Ra((R RRR!s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyt find_r_to_boundary_of_closedpath�s

cCs�|j�}t|�\}}||d�}d}|}	tj}
d}d}xd|D]\\}}|}|t|�d7}||d�|kr�|
|	d|g�}Pn|}	qVW|dkr�td��nt|ddd�|ddd��}
t|
||�\}}t|�dkrEt	j
g}t	jt	j
g}n�t|�dkr�t	jt	jg}t	jt	jt	jg}nTt|�dkr�t	j
t	j
t	j
g}t	jt	j
t	j
t	j
g}n	t��|d}|}|jdkr9t	|
|j| |g��}t	|
||j|g��}njt	|
|j| |g�|
|j| |g��}t	|
||j|g�|
||j|g��}|r�|tkr�||}}n||fS(	sW divide a path into two segment at the point where inside(x, y)
    becomes False.
    i����iiis2The path does not seem to intersect with the patchNii(t
iter_segmentstnexttNoneR,tconcatenateR0RtzipR_RtLINETOtMOVETOtCURVE3tCURVE4tcodestverticestFalse(tpathtinsideR:t
reorder_inoutt	path_itert
ctl_pointstcommandtbegin_insidetbezier_pathtctl_points_oldtconcattioldtitbptlefttrightt
codes_lefttcodes_rightt
verts_lefttverts_righttpath_intpath_out((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pytsplit_path_inout�sV	
)!	
"cs#|d����fd�}|S(Nics*|\}}|�d|�d�kS(Ni((RbRR(RRtr2(s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyRa2s((RRR`Ra((RRR�s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyt
inside_circle/s
cCs=||||}}||||d}||||fS(Ng�?((tx0ty0R#R$tdxtdyR((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pytget_cos_sin:sg�h㈵��>cCsotj||�}tj||�}tj||�}||krGdStj|tj�|krgdStSdS(s� returns
       * 1 if two lines are parralel in same direction
       * -1 if two lines are parralel in opposite direction
       * 0 otherwise
    ii����N(R,tarctan2tabstpiRq(tdx1tdy1tdx2tdy2R:ttheta1ttheta2tdtheta((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pytcheck_if_parallel@sc	Cs�|d\}}|d\}}|d\}}t||||||||�}|dkr�tjd�t||||�\}	}
|	|
}}n6t||||�\}	}
t||||�\}}t|||	|
|�\}
}}}t|||||�\}}}}|dkr`d|
|d||}}d||d||}}nNt|
||	|
||||�\}}t|||	|
||||�\}}|
|f||f||fg}||f||f||fg}||fS(s�
    Given the quadratic bezier control points *bezier2*, returns
    control points of quadratic bezier lines roughly parallel to given
    one separated by *width*.
    iiii����s8Lines do not intersect. A straight line is used instead.g�?(R�twarningstwarnR�R'R(tbezier2twidthtc1xtc1ytcmxtcmytc2xtc2yt
parallel_testR	R
R
Rtc1x_lefttc1y_leftt	c1x_rightt	c1y_righttc2x_lefttc2y_leftt	c2x_rightt	c2y_righttcmx_lefttcmy_leftt	cmx_rightt	cmy_rightt	path_leftt
path_right((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyt
get_parallelsQs8$$ 				cCsKdd|||}dd|||}||f||f||fgS(s� Find control points of the bezier line throught c1, mm, c2. We
    simply assume that c1, mm, c2 which have parametric value 0, 0.5, and 1.
    g�?i((R�R�tmmxtmmyR�R�R�R�((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pytfind_control_points�sg�?c%Cs�|d\}}|d\}}|d\}	}
t||||�\}}t|||	|
�\}
}t||||||�\}}}}t|	|
|
|||�\}}}}||d||d}}||	d||
d}}||d||d}}t||||�\}}t||||||�\}} }!}"t|||| ||�}#t|||!|"||�}$|#|$fS(s�
    Being similar to get_parallels, returns control points of two quadrativ
    bezier lines having a width roughly parralel to given one separated by
    *width*.
    iiig�?(R�R'R�(%R�R�tw1twmtw2R�R�R�R�tc3xtc3yR	R
R
RR�R�R�R�tc3x_lefttc3y_leftt	c3x_rightt	c3y_righttc12xtc12ytc23xtc23ytc123xtc123ytcos_t123tsin_t123t
c123x_leftt
c123y_lefttc123x_righttc123y_rightR�R�((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pytmake_wedged_bezier2�s&(((		cCsf|j}|dkr^tj|jjd d�}|jtj�tj	|d<t|j|�S|SdS(s$
    fill in the codes if None.
    iR}iN(
RoRhR,temptyRptshapetfillRRkRl(tpR((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pytmake_path_regular�s	
cCsng}g}x:|D]2}t|�}|j|j�|j|j�qWttj|�tj|��}|S(s7
    concatenate list of paths into a single path.
    (R�R/RpRoRR,Ri(tpathsRpRoR�t_path((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pytconcatenate_paths�s
(RYt
__future__RtnumpyR,tmatplotlib.pathRtoperatorRR�RRRR'R+R5RBtobjectRCR_ReRqR�R�R�R�R�R�R�R�R�(((s7/usr/lib64/python2.7/site-packages/matplotlib/bezier.pyt<module>s.				0*D			G	0	

Anon7 - 2021