o
    Zh0hu                     @   s   d Z G dd deZdS )zTransformation matrix.c                       sR   e Zd Zd fdd	Zdd Zedd	 Zed
d Zdd Zedd Z	  Z
S )Matrix       Nc                    s4   |d u r||dg||dg||dgg}t  | d S )Nr   r   )super__init__)selfabcdefmatrix	__class__ G/var/www/html/rh/venv/lib/python3.10/site-packages/weasyprint/matrix.pyr      s   zMatrix.__init__c                    s\   t d t    krt  d   krdksJ  J t fddtt D dS )Nr      c                    s&   g | ]  fd dt dD qS )c                    s,   g | ] t  fd dtdD qS )c                 3   s(    | ]}  | |   V  qd S )Nr   ).0k)ijotherr   r   r   	<genexpr>   s   & z:Matrix.__matmul__.<locals>.<listcomp>.<listcomp>.<genexpr>r   )sumranger   )r   r   r   )r   r   
<listcomp>   s   , z0Matrix.__matmul__.<locals>.<listcomp>.<listcomp>r   )r   r   r   r   )r   r   r      s    z%Matrix.__matmul__.<locals>.<listcomp>r   )lenr   r   )r   r   r   r   r   
__matmul__
   s   :

zMatrix.__matmul__c              	   C   s  | j }t| 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 | 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 | d d  | d d | d d   | | d d | d d  | d d | d d   |  | d d | d d  | d d | d d   | ggdS )Nr      r   r   )determinantr   )r   r
   r   r   r   invert   s   242424242zMatrix.invertc                 C   s   t | t | d   krdksJ  J | 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     S )Nr   r   r   r!   )r   )r   r   r   r   r"   %   s   (:::zMatrix.determinantc                 C   s"   t ||dggd|  d d d S )Nr   r   r   r!   )r   )r   xyr   r   r   transform_point-   s   "zMatrix.transform_pointc                 C   s0   dd | D \\}}\}}\}}||||||fS )Nc                 S   s   g | ]}|d d qS )Nr!   r   )r   columnr   r   r   r   2   s    z!Matrix.values.<locals>.<listcomp>r   )r   r   r   r	   r
   r   r   r   r   r   values0   s    zMatrix.values)r   r   r   r   r   r   N)__name__
__module____qualname__r   r    propertyr#   r"   r&   r(   __classcell__r   r   r   r   r      s    

r   N)__doc__listr   r   r   r   r   <module>   s    