Page 1 of 1

Bezier line

Posted: Wed Jan 12, 2005 3:29 pm
by 8127944
I am using a bezier line in my chat, and it works fine so far.

But i am wondering while the bezier line always hits every fourth data point. Is this a wanted feature of your bezier-function?
Or can I change this behaviour.

Thanks a lot, Markus.

Posted: Thu Jan 13, 2005 1:05 pm
by narcis
Hi Markus,

That's not true, the bezier series are based on Bezier Curve algorithmand the variables under it can't be changed. The hits depend on your series points, you can try adding values to your bezier series using FillSampleValues and you will see that it's not allways 4.

Posted: Thu Jan 13, 2005 1:53 pm
by 8127944
I have included a bezier line into my chart.

Then I started the TeeChart Editor and changed the DataSource of the bezier line to "Random".
Then I pressed several times "Apply" (with a number of sample values of 25).

The resulting line always goes exactly through the points: 1, 4, 7, 10, 13, ...

I understand that a cubic Bezier curve is defined by four points, but for my understandign this does not mean that the calculation hast to be done in this interval.

following link includes nice java applets where you can see how to blend more than four data points together - resulting in a bezier curve over all points.

http://www.doc.ic.ac.uk/~dfg/AndysSplin ... ziers.html


Thanks for your assistance, Markus

Posted: Thu Jan 13, 2005 3:16 pm
by narcis
Hi Markus,

If you populate your bezier series with the code line below and zoom the series you will see in some cases that it's not every 4 points.

Code: Select all

bezier1.FillSampleValues(100);
Anyway for a better aproach to your needs you may be interested in a smoothing function series.

Posted: Thu Jan 13, 2005 4:38 pm
by 8127944
I have done it, but what I saw was the same effect as with 25 sample points.

I think you are calculating the bezier curve always fixed over four points and then switch to the next four points, this will result in this kind of curve.

May be there is a smoother way to move from point to point. Because in general the bezier function whould be a good apoximation function - a good additional feature to the b-spline function of your other smoothing function.

But thanks for your reply, you are offering a good service.

Markus.