Sign in to follow this  
Felipe M

Get a formula from a graph

Recommended Posts

Felipe M    148

Does anyone know a good software or web service where you can draw a graph an get the formula?

 

 

Like: I input three points: (0,0), (6,9), (10,10). Then I see a curve that perfectly intersects those three points and get the formula for it.

 

There are a lot of situations in game developement when that would be useful. Like if you want the speed of something slowly start rising, and then rise faster and faster until it stabilizes and then start rising slower and slower until its not rising anymore. Things like that. If you could just visualize this variation of speed on a graph and get the formula to implement in your game would be awesome.

Share this post


Link to post
Share on other sites
alvaro    21246

Pretty good. But it seems to make a mean of some of the points or something. It doesn't intersects all of the points if I make some more.


Try this instead:

interpolating polynomial {{0,0},{6,9},{10,10},{3,5}}

Share this post


Link to post
Share on other sites
Felipe M    148

Wow that's exactly what I wanted. Thank you guys.

 

I have tried wolfram alpha before posting here, this website is very handy and I use from time to time. It's just difficult if you're not into the terms...

Share this post


Link to post
Share on other sites
Tutorial Doctor    2573

I tried this once, I do think the term was "curve fitting" I think I was trying to use Microsoft Excel to do it.

Interpolating polynomial does sound like a better choice though, also there is the term "parametric equations" where there is a certain equation that allows you to set the points and interpolate between them (I actually knew the equation). We used it in calculus to draw out a letter.

I will see if I can find it (because you could use this in a program)

Edited by Tutorial Doctor

Share this post


Link to post
Share on other sites
Quat    568

I could be wrong, but I think something like cubic spline interpolation might be better than nth degree polynomial.  A polynomial can get some pretty wild oscillations to fit the data points. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this