Get a formula from a graph

Started by
7 comments, last by Tutorial Doctor 10 years, 2 months ago

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.

Advertisement

http://www.wolframalpha.com/

type in:

quadratic fit {{0,0},{6,9},{10,10}}

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.

How would I draw a graph like this?

http://draw.to/D2QbLEi

http://en.wikipedia.org/wiki/B%C3%A9zier_curve

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}}

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...

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)

They call me the Tutorial Doctor.

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.

-----Quat

I think that was it Quat, the nth degree polynomial. Good tip too.

They call me the Tutorial Doctor.

This topic is closed to new replies.

Advertisement