Hong-Phuc Bui
9 days ago e2c0c968eecec4a90ea5a432e1db1ba4a50df93e
nicegui-tk-bezier/bezier.py
@@ -2,12 +2,12 @@
Module related to bezier curve
"""
def make_cubic_bezier(control_points: [(float, float)], n: int = 10) -> [(float, float)]:
    """"
    r""""
    Interpolate a Bezier-curve by split it into segments of lines (=polyline).
    A Bezier-Curve is defined by
        \[
            B(P_0, P_1, P_2, P_3:t) = (1-t)^3*P_0 + 3(1-t)^2*t*P_1 + 3(1-t)*t^2*P_2 + t^3*P_3
           B(P_0, P_1, P_2, P_3:t) = (1-t)^3*P_0 + 3(1-t)^2*t*P_1 + 3(1-t)*t^2*P_2 + t^3*P_3
        \]
    for $t \in \[0, 1\]$