Skip to content

Commit ae2480c

Browse files
authored
Merge pull request #1442 from mathics/bezier-again
Add another BezierFunction example
2 parents d6ead61 + eca58e5 commit ae2480c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mathics/builtin/drawing/splines.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ class BezierFunction(Builtin):
5353
=
5454
5555
## Graphics[{Red, Point[pts], Green, Line[pts]}, Axes -> True]
56+
57+
Plotting the Bézier Function accoss a Bézier curve:
58+
>> Module[{p={{0, 0},{1, 1},{2, -1},{4, 0}}}, Graphics[{BezierCurve[p], Red, Point[Table[BezierFunction[p][x], {x, 0, 1, 0.1}]]}]]
59+
= -Graphics-
5660
"""
5761
rules = {
5862
"BezierFunction[p_]": "Function[x, Total[p * BernsteinBasis[Length[p] - 1, Range[0, Length[p] - 1], x]]]"

0 commit comments

Comments
 (0)