Page 1 of 1

Cubic Spline? Anyone?

Posted: Mon Aug 24, 2020 6:07 pm
by trevix
Hi.
I have been using the graph widget but I would like to convert a scattered set of points (X,Y) to a smooth curved line (like in the attachment).
So, giving up the graph widget, I did some research and I realized that:
- my math sucks
- probably i need to do "cubic spline interpolation" (!?)

Somebody has done this already or is willing to share some simple math example?

Thanks
(I've seen the BezieCurve in the Rasberry section but I am not sure if is the correct example to study)

Re: Cubic Spline? Anyone?

Posted: Mon Aug 24, 2020 7:51 pm
by richmond62
https://en.wikiversity.org/wiki/Cubic_S ... polynomial.

Ooer: that only served to remind me that, at about 16, I got off the 'Maths Train.'

Re: Cubic Spline? Anyone?

Posted: Mon Aug 24, 2020 9:14 pm
by trevix
Gasp!
Not very helpful to me.
I need some LC code

Re: Cubic Spline? Anyone?

Posted: Mon Aug 24, 2020 9:50 pm
by richmond62
Actually that Wikipedia page explains things in a comparatively comprehensible fashion.

Re: Cubic Spline? Anyone?

Posted: Tue Nov 24, 2020 12:55 pm
by stam
richmond62 wrote:
Mon Aug 24, 2020 7:51 pm
https://en.wikiversity.org/wiki/Cubic_S ... polynomial.

Ooer: that only served to remind me that, at about 16, I got off the 'Maths Train.'
I like to think I'm OK at maths but that wikipedia page made my eyes water... :shock: :shock:


A cursory search found this: livecode-bezier-line-demo
Untested and don't know if it will help, but worth a look...

Re: Cubic Spline? Anyone?

Posted: Tue Nov 24, 2020 4:19 pm
by Klaus
stam wrote:
Tue Nov 24, 2020 12:55 pm
I like to think I'm OK at maths but that wikipedia page made my eyes water... :shock: :shock:
I was alway weak at math, and yes, I immediately closed the page above when I saw it!
stam wrote:
Tue Nov 24, 2020 12:55 pm
A cursor search found this: livecode-bezier-line-demo
Untested and don't know if it will help, but worth a look...
Ah, one of Scott Rossis stacks, can't be wrong and will surely look gorgeous! :-)