Context: this is part of a series of reposts of some of my more popular blog posts. It was originally posted in June 2013 here http://tomforsyth1000.github.io/blog.wiki.html#%5B%5BPolynomial%20interpolation%5D%5D. This version has been edited slightly to update for the intervening years.
I was reminded of this one recently when I saw this video by Stand Up Maths [https://www.youtube.com/watch?v=F_43oTnTXiw] / Matt Parker [https://mastodon.gamedev.place/@standupmaths@mathstodon.xyz/109819371402062543]. He uses some heavy tools, but I remembered that you don't need a maths degree to figure out an approximating polynomial for any function, and indeed it's fast enough you can do it in a game at runtime - it doesn't need to be precalculated - so it's enormously useful for all sorts of game-related things like graphics and gameplay. Anyway, on to the post.
In work recently [2013, PC VR at Oculus] I've been dealing with fitting polynomial curves to set of points. Normally for this job you'd reach for Mathematica or some other heavy-math package and use the right incantations. It would do Magic Math Stuff and spit out the right answer. The problem if you didn't really understand the question, and so you don't really understand the solution, and certainly it's hard to do things like implement at runtime in your own code, or explain why it doesn't work in some cases. So I do like to at least try to do it myself with my high-school math skills before reaching for the Math Wand.
Feed Your Brain Friday gratuitous rehost!