Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/svgwrite/extensions/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/svgwrite/extensions/__pycache__/shapes.cpython-311.pyc

�

�܋f���:�dZddlZd
d�Zdd�Zd�Zd�Zd�Zd	�ZdS)z+
Extension to create and manipulate shapes
�N�c#�K�|dkrtd���|�(|dztjtj|z��z}n'|�|dkrtd���ntd���dtjz|z}|}t	|��D]7}|tj|��z|tj|��zfV�||z
}�8dS)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.N�rz+Argument `radius` has to be greater than 0.z,Argument `edge_length` or `radius` required.)�
ValueError�math�sin�pi�range�cos)�num_corners�edge_length�radius�rotation�delta�angle�_s       �k/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/svgwrite/extensions/shapes.py�ngonr	s������Q����K�L�L�L����q��4�8�D�G�k�,A�#B�#B�B���	�	��R�<�<��J�K�K�K���G�H�H�H�
���K�+�%�E��E�
�;�
�
����������'��$�(�5�/�/�)A�B�B�B�B�
�������c#�,K�|dkrtd���|dkrtd���|dkrtd���t|||���}t||tj|z|z���}t	||��D]
\}}|V�|V��dS)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.rz'Argument `r1` has to be greater than 0.z'Argument `r2` has to be greater than 0.)rrN)rrrr
�zip)�spikes�r1�r2r�corners1�corners2�s1�s2s        r�starr (s����� ��z�z��F�G�G�G�	�R�x�x��B�C�C�C�	�R�x�x��B�C�C�C��F�2��9�9�9�H��F�2�����x�0G�H�H�H�H��h��)�)�����B�����������rc#�2K�|D]\}}||z||zfV��dS)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

    N�)�vertices�delta_x�delta_y�x�ys     r�	translater(F�A�����)�)���1��7�{�A��K�(�(�(�(�(�)�)rc#�2K�|D]\}}||z||zfV��dS)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")r#�scale_x�scale_yr&r's     r�scaler-Vr)rc#��K�|D]b\}}tj||��}tj||��|z}|tj|��z|tj|��zfV��cdS)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	)r#rr&r'�rrs      r�rotater2fsz�����9�9���1��J�q�!�����
�1�a� � �5�(���4�8�E�?�?�"�A������$7�8�8�8�8�8�9�9rc�P�d\}}}|D]\}}||z
}||z
}|dz
}�||z||zfS)z:
    Returns the centroid of a series of `vertices`.

    )rrr�r")r#�k�c_x�c_yr&r's      r�centroidr8wsR��
�K�A�s�C������1��q����q���	�Q������7�C�!�G��r)NNr)r)�__doc__rrr r(r-r2r8r"rr�<module>r:s�����
��������>����<
)�
)�
)� 
)�
)�
)� 9�9�9�"
�
�
�
�
r

Hacked By AnonymousFox1.0, Coded By AnonymousFox