Message Boards Message Boards

0
|
5720 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to make a Bezier curve of higher order?

Posted 10 years ago

Hi there,

BezierCurve by default represents a cubic Bezier curve. How would I make it third or maybe even forth order in Mathematica?

Thank you for your help.

POSTED BY: Mitja Jan?i?
4 Replies

It sure does! That is exactly the change I was looking for.

Thank you, Bill!

POSTED BY: Mitja Jan?i?
Posted 10 years ago

Compare this

points = {{0, -0.5472612856615164`}, {1, -2.5034530266845003`}, {2, -1.8872659003939827`},
 {3, -1.1793732412661466`}, {4, -3.068235490752336`}, {5, 3.4990177037576604`},
 {6, -1.7312121463142187`}, {7, -1.6648538152327106`}, {8, -2.373301294370746`},
 {9, 3.900761915519949`}, {10, -2.134289137239122`}};
Graphics[{BezierCurve[points, SplineDegree -> 6], Red, Point[points]}, Axes -> True]

with this

Graphics[{BezierCurve[points], SplineDegree -> 6, Red, Point[points]}, Axes -> True]

with this

Graphics[{BezierCurve[points], Red, Point[points]}, Axes -> True]

Those points were nothing special, I just made them up with RandomReal[{-4,4}], but included them here so that we would have a very concrete specific example to look at.

From that it appears thatif Graphics is given the SplineDegree option it silently ignores it, while if BezierCurve is given that option it does result in a different curve.

Does this solve your problem?

POSTED BY: Bill Simpson

So this does the job?:

Graphics[{BezierCurve[points], SplineDegree -> 6, Red, Point[points]},Axes -> True]

Because, I would expect for my curve to change (with comparisson with cubic) at least so much that I could notice that with my eyes, and it does not. (It is my first time using higher degree Bezier curves.)

POSTED BY: Mitja Jan?i?
Posted 10 years ago

Look at the documentation page BezierCurve and click on Details and Options and read that carefully.

POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract