Hong-Phuc Bui
9 days ago e2c0c968eecec4a90ea5a432e1db1ba4a50df93e
fix docstring
2 files modified
9 ■■■■ changed files
nicegui-tk-bezier/README.md 5 ●●●●● patch | view | raw | blame | history
nicegui-tk-bezier/bezier.py 4 ●●●● patch | view | raw | blame | history
nicegui-tk-bezier/README.md
@@ -1,5 +1,7 @@
# Demo NiceGUI vs Tk
Eine kleine Demonstration von Plot-Möglichkeiten in NiceGUI via HTML-Canvas und Tk Canvas
## Install
```bash
@@ -11,6 +13,9 @@
## Run
In beide Programm kann man 4 Punkten einer (Kubischen) Bezier-Kurve mit Mouse-Klicks bestimmen,
danach wird eine Kurve angezeigt.
### Tk
```bash
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\]$