
    'j                    T    d dl mZ d dlmZ d dlZd dlmZ  G d d          ZddZ	dS )    )annotations)IterableN)Vec3c                  "    e Zd ZdZddZddZdS )CSplinea[  
    In numerical analysis, a cubic Hermite spline or cubic Hermite interpolator
    is a spline where each piece is a third-degree polynomial specified in
    Hermite form, that is, by its values and first derivatives at the end points
    of the corresponding domain interval.

    Source: https://en.wikipedia.org/wiki/Cubic_Hermite_spline
    p0r   p1m0m1c                >    || _         || _        || _        || _        d S )Nr   r	   r
   r   )selfr   r	   r
   r   s        L/DATA/AppData/hermes/venv/lib/python3.11/site-packages/ezdxf/math/cspline.py__init__zCSpline.__init__   s"        tfloatreturnc                    ||z  }||z  }|dz  |dz  z
  dz   }| dz  |dz  z   }||dz  z
  |z   }||z
  }| j         |z  | j        |z  z   | j        |z  z   | j        |z  z   S )Ng       @g      @      ?r   )r   r   t2t3h00h10h01h11s           r   pointzCSpline.point   s    U!V3hc!C'cCi"s("28ma2gw}tw},tw}<tw}LLr   N)r   r   r	   r   r
   r   r   r   )r   r   r   r   )__name__
__module____qualname____doc__r   r    r   r   r   r   
   sL            M M M M M Mr   r   csplinesIterable[CSpline]r   Iterable[Vec3]c              #  t   K   | D ]2}t          j        dd|          D ]}|                    |          V  3d S )Ng        r   )nplinspacer   )r#   countcspliner   s       r   approximater+   %   s\       # #S#u-- 	# 	#A--""""""	## #r   )r#   r$   r   r%   )

__future__r   typingr   numpyr'   
ezdxf.mathr   r   r+   r"   r   r   <module>r0      s    # " " " " "                M M M M M M M M6# # # # # #r   