# Get a formula from a graph

This topic is 2086 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 on other sites

http://www.wolframalpha.com/

type in:

##### Share on other sites

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

##### Share on other sites

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.

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

##### Share on other sites

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 on other sites

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 on other sites

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 on other sites

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

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 9
• 15
• 9
• 11