Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.9K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to change the degree of BezierFunction

Posted 12 years ago

Fitting BezierFunction to n points, by default does a n-1 degree Bezier Curve. I don't want that, I want way less.

For example, I have 150 points, therefore it does a Bezier of 149 degree, yet I would want it to bo cubic or maybe 4 degree.

How can I change that?

Thanks for the help!

POSTED BY: Mitja Jan?i?
2 Replies

Can be done with BSplineCurve[], which accepts SplineDegree as option

In[2]:= data = RandomReal[{-2, 5}, {150, 2}];

In[14]:= Graphics[{BSplineCurve[data, SplineDegree -> 4], Green, Line[data], Red, Point[data]}]

as higher the spline degree is, the more the curve concentrates away from outlier points. Despite the manual you cannot give SplineDegree with a value other than Automatic to BezierFunction[]

In[15]:= f4 = BezierFunction[data, SplineDegree -> 4]
BezierFunction::invdeg: Value of option SplineDegree -> 4 should be a positive integer, or a list of positive integers. >>

I tended to consider 4 as a positive integer ... compare the manual (Mathematica 10.0.0 Windows 7 64 Bit):

BezierFunction SplineDegree

seems to be a bug.

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