nesdev.comhttp://forums.nesdev.com/ How good are you at math?http://forums.nesdev.com/viewtopic.php?f=5&t=16194 Page 1 of 4

 Author: GradualGames [ Sun Jul 09, 2017 12:50 pm ] Post subject: How good are you at math? I did...okay...at math in highschool and college. Didn't knock anyone's socks off with grades. I'm decent enough with everyday arithmetic and trigonometry to find my way around in 2D game development. Like for example, I just integrated an atan2 routine into my current NES game to implement following behavior, and generated fixed point cos/sin tables for the velocity using python.But knowing how to USE math is way different from a deep understanding of it. Like, I find myself wondering: How does the "sin" function in most programming libraries work? When I look it up it sounds horrifyingly complex and I find my way to a wikipedia page about a Taylor series. I seem to vaguely recall learning you can compute sin with a taylor series somewhere. But...since I can pragmatically just USE the results of math functions for my games without having a really really deep understanding of why they work, I don't bother putting in the effort to understand them at that level.I guess I was curious how many folks here are/were so good at math that you feel you have a proof-level depth of understanding of some of the types of math that we use daily as game programmers. I often feel frustrated when I can't TOTALLY understand something, but as I get older, pragmatism is taking a stronger hold and I'm less upset when I just have to use something instead of understand absolutely every facet of it down to the proof of a theorem. I WISH I could understand it all in its entirety, but...in a way math is the same thing as the open source programming world...there are tons of pragmatic results there for you to just USE, we don't all have to absorb absolutely all of how to derive all of it the way the original discoverers of these things did.It's been 11 years since I've even done a math problem on paper, I think, I graduated college in 2006! All of the professional coding I've done hasn't involved any mathematics at all (in the sense I'm describing anyway). I maybe used a tiny, tiny bit of linear algebra once with some rotation animation or other on Android at some point in the past, but even that's been abstracted out so far at this point you barely need to know anything to use it.

 Author: GradualGames [ Sun Jul 09, 2017 1:27 pm ] Post subject: Re: How good are you at math? I guess this is no different than, say, not exhaustively understanding how an OS works. It'd probably take me years to understand everything needed to write a small unix like kernel for instance. On the same token it would probably take me years to learn how to prove all of the math that I use on a daily basis, exhaustively. It's just not worth it when you're after pragmatic results based on things that are available to use, I guess.

 Author: Bregalad [ Sun Jul 09, 2017 2:12 pm ] Post subject: Re: How good are you at math? I used to be good at math, or at least pretty decent. In highscool it was my favourite discipline by far, and I was pretty good. In uni however the level of expectations was much, MUCH higher and we had to solve problems that were so crazy, for example having multidimentional integrals to compute. it was almost insane. I managed to get by, but mediocrely, fixing my previous impression that I was good at math. I especially loved gemometry, but I liked algebra as well.At the 2nd grade in uni this went even more insane and unfortunately I had an absolutely awful professor which was full of hatred towards students and absolutely did not want us to learn but just proof us we sucked at math. So he disgusted me of math and since then I avoided math like cancer. Which is really shame, since I originally loved it !Taylor's series is an extremely simple concept that allows to do great interpolation around a point. If I were to code a sine function I'd probably just ressort to lookup tables and interpolation, however Taylor series can greatly improve the interpolation as instead to connect dots directly it will epouse the shape of the function locally. Usually only one or two extra terms are necessary, but you can go as far as you'd like. If you'd use a Taylor series with more terms, the interpolation will be so good that you can make the lookup table much smaller, actually in extreme cases you could just have angles like 0°, 30°, 45°, 60° etc... and do the others angles just with Taylor's series. The problem is that there will could still be some discontunity when using Taylor approximation from one point and then moving to the next point.

 Author: Myask [ Sun Jul 09, 2017 2:34 pm ] Post subject: Re: How good are you at math? How good are you at doping silicon, fabbing plastic shells?These strike me as about as relevant as grokking those proofs of how computers gen sin(θ), to game development.Quote:I'm decent enough with […] trigonometry to find my way around in 2D game development. You know that is not common, right?

 Author: GradualGames [ Sun Jul 09, 2017 2:49 pm ] Post subject: Re: How good are you at math? Myask wrote:How good are you at doping silicon, fabbing plastic shells?These strike me as about as relevant as grokking those proofs of how computers gen sin(θ), to game development.Quote:I'm decent enough with […] trigonometry to find my way around in 2D game development. You know that is not common, right?By decent enough I mean I know the basic definitions of sin, cos, and tan, how to solve for sides of triangles, converting between radians and degrees (or other subdivisions) etc. Super super simple stuff. That's not common!?

 Author: GradualGames [ Sun Jul 09, 2017 2:55 pm ] Post subject: Re: How good are you at math? Bregalad wrote:Taylor's series is an extremely simple concept that allows to do great interpolation around a point.Really simple eh? like...why does it work? I've kind of gathered it's an infinite sum of derivatives of a function (with other terms in the formula I don't yet understand) which approximates the shape of the actual function, so if you can keep computing the derivative of a function you can get as much precision as you want for the function you're going for, right? So ok...but like the formula itself, WHY does it work. Why is there a factorial in the formula. etc. etc. Like, it's not bad to find out the high level definition of something and plug and chug and just use it, but ...I want to know how it was discovered and derived to begin with. It amazes me when I think about that somebody figured these things out, on paper.

 Author: lidnariq [ Sun Jul 09, 2017 3:03 pm ] Post subject: Re: How good are you at math? Derivative of xn = n·xn-1Do it again: n·(n-1)·xn-2And again: n·(n-1)·(n-2)·xn-3Looks like factorial, no?

 Author: GradualGames [ Sun Jul 09, 2017 4:40 pm ] Post subject: Re: How good are you at math? lidnariq wrote:Derivative of xn = n·xn-1Do it again: n·(n-1)·xn-2And again: n·(n-1)·(n-2)·xn-3Looks like factorial, no?Oh, cool! That makes sense (seeing the pattern there...still don't have any idea how somebody figured this out to begin with). Well, I still am confused because...I understand you can approximate the sin function with the derivative(s) of sin at just one point. What I don't get is how does it work that you can approximate a whole function just from the derivatives at one point?

 Author: tokumaru [ Sun Jul 09, 2017 4:47 pm ] Post subject: Re: How good are you at math? lidnariq wrote:Derivative of xn = n·xn-1Do it again: n·(n-1)·xn-2And again: n·(n-1)·(n-2)·xn-3Looks like factorial, no?When I look at stuff like this (which flies completely over my head) I realize I suck at math. I barely managed to pass calculus in college.