Cubic Spline? Anyone?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
trevix
Posts: 565
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Cubic Spline? Anyone?

Post by trevix » Mon Aug 24, 2020 6:07 pm

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)
Attachments
Schermata 2020-08-24 alle 19.01.39.png
Trevix
OSX 10.14.6 LC 9.6.0 Dp2 iOs 9.3>

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5071
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Cubic Spline? Anyone?

Post by richmond62 » 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.'

trevix
Posts: 565
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Cubic Spline? Anyone?

Post by trevix » Mon Aug 24, 2020 9:14 pm

Gasp!
Not very helpful to me.
I need some LC code
Trevix
OSX 10.14.6 LC 9.6.0 Dp2 iOs 9.3>

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5071
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Cubic Spline? Anyone?

Post by richmond62 » Mon Aug 24, 2020 9:50 pm

Actually that Wikipedia page explains things in a comparatively comprehensible fashion.

stam
Posts: 167
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Cubic Spline? Anyone?

Post by stam » Tue Nov 24, 2020 12:55 pm

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...
Last edited by stam on Wed Nov 25, 2020 3:05 pm, edited 1 time in total.

Klaus
Posts: 12090
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Cubic Spline? Anyone?

Post by Klaus » Tue Nov 24, 2020 4:19 pm

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! :-)

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”