# Thread: Maths For Game Programming?

1. ## Maths For Game Programming?

Calculus
Section 1: What Is A Derivative?
Section 2: The Derivative Defined As A Limit
Section 3: Differentiation Formulas
Section 4: Derivatives Of Trigonometric Functions
Section 5: The Chain Rule
Section 6: Higher Order Derivatives
Section 7: Related Rates
Section 8: Curve Sketching Using Derivatives
Section 9: Introduction To Integrals
Section 10: Solving Integrals
Section 11: Integration By Substitution
Section 12: Calculating Volume With Integrals
Section 13: Derivatives and Integrals Of Exponentials
Section 14: Derivatives Of Logarithms
Section 15: Integration By Parts
Section 16: Integration By Trig Substitution
Section 17: Improper Integrals

Section 1: Inverse Trigonometric Functions
Section 2: Derivatives of Inverse Trigonometric Functions
Section 3: Hyperbolic Functions
Section 4: Inverse Hyperbolic Functions
Section 5: L'Hospital's Rule
Section 6: Trigonometric Integrals

Section 7: Integration By Partial Fractions
Section 8: Arc Length
Section 9: Area Of A Surface Of Revolution
Section 10: Parametric Equations
Section 11: Arc Length In Parametric Equations
Section 12: Surface Area Of Revolution In Parametric Equations

Section 13: Polar Coordinates
Section 14: Polar Equations
Section 15: Area And Length In Polar Coordinates
Section 16: Sequences

Section 17: Series
Section 18: Integral Test Of Series Convergence
Section 19: Comparison Tests Of Series Convergence
Section 20: Alternating Series Test Of Convergence
Section 21: Ratio and Root Test Of Series Convergence

Calculus 3
Section 1: 3D Cartesian Coordinates
Section 2: Introduction To Vectors
Section 3: The Vector Dot Product
Section 4: The Vector Cross Product
Section 5: Vector Valued Functions
Section 6: Multivariable Functions And Partial Derivatives
Section 7: The Chain Rule For Partial Derivatives
Section 8: The Directional Derivative
Section 10: Double Integrals
Section 11: Double Integrals In Polar Coordinates

Section 1: Triple Integrals
Section 2: Triple Integrals In Cylindrical Coordinates
Section 3: Triple Integrals In Spherical Coordinates
Section 4: Divergence And Curl Of A Vector Field
Section 5: Line Integrals
Section 6: Line Integrals In A Vector Field
Section 7: Alternative Form Of Line Integrals In Vector Fields
Section 8: Fundamental Theorem Of Line Integrals
Section 9: Green's Theorem
Section 10: Surface Integrals
Section 11: Flux Integrals
Section 12: Stokes Theorem
Section 13: The Divergence Theorem

Are these enough to be knowledgeable in game programming without getting confused? Of course, the prerequisite to get into game programming is just programming, but i'm just talking about maths that is involved.

2. "Without getting confused" is a broad concept. The list you show is pretty comprehensive, so if you study that AND UNDERSTAND ALL OF it, I'm sure you will have no problem with a game programming course.

Most of the math in 3D graphics is based on fairly simple math (trigonometry is a good start, some general algebra). There are some complex bits too, but most of it is pretty basic. Presumably, a game programming class would cover most of what you actually need.

And of course, very often, game programmers (and other programmers) cheat and just read a book or website where someone else figured out how to solve a particular problem.

--
Mats

3. unless your game has to model sub-atomic reactions between fundamental particles, the most math you will likely need is trig and geometry. Matrix equations help as well, but dirivatives and integrals, forget it they are unnecessary. You are simulating reality, not modelling it.

4. This question needs to be on the FAQ or stickied, because it is far too frequently asked. So if a mod agrees... or Kermi for that matter.

5. If you're just interested in making games you don't need to know a lot of that information.

EDIT:
And of course, very often, game programmers (and other programmers) cheat and just read a book or website where someone else figured out how to solve a particular problem.
That isn't cheating, that's the norm, especially if you are trying to actually produce something. In a paid position nobody really cares if you can derive an equation, you just have to get it to work.

6. Agreed. Am I a cheater when I copy and paste code for doing a GTK treeview beause I do not know the code off hand without copying from a site aimed at teaching people how to do produce a certain kind of GUI? Are we cheaters when we use OpenGL or DX instead of contacting nVidia and AMD ATI for GPU opcodes so we can write our own API for games?

7. Originally Posted by BobMcGee123
That isn't cheating, that's the norm, especially if you are trying to actually produce something. In a paid position nobody really cares if you can derive an equation, you just have to get it to work.
Oh, I agree fully with that. It is a good idea if you UNDERSTAND the underlying math, but if you don't, but can get it right by reading a book or website, that's fine too. I didn't mean cheating in, say, the way you'd cheat at a maths test using a calculator (where a calculator is not allowed), but rather, the programmer doesn't always figure out what the calculation should be, if there is an existing solution available that does the job.

--
Mats

8. Originally Posted by matsp
Oh, I agree fully with that. It is a good idea if you UNDERSTAND the underlying math, but if you don't, but can get it right by reading a book or website, that's fine too. I didn't mean cheating in, say, the way you'd cheat at a maths test using a calculator (where a calculator is not allowed), but rather, the programmer doesn't always figure out what the calculation should be, if there is an existing solution available that does the job.

--
Mats
Agreed. If you do not know how to go about doing something, it makes it so much harder to fix something when you accidentally forgot to bookmark that site that you were using to write your code.

9. Yeah I agree with the past comments. The more you understand, the better, but it is not an absolute requirement in a lot of cases.

10. I would argue that in most cases it is not. Don't be shy now, how many of you guys also used to dabble with DX or OpenGL before taking a trig class? Did your demos suffer from your lack of trig? Probably not as much as one would think. However, there were times when you'd spend a lot of time just copying over code taking a leap of faith that it was right, or "best." A lot of people just sort of go with the flow with their rotation matrices until they learn some linear algebra and realize some of the nice things they can do without using extra streps.

11. Ironically enough the only reason I ever understood anything in any math class I took was because I was dabbling with OpenGL. Don't get me wrong, I've always tried to understand everything at the most fundamental level humanly possible. But this slows your progress.

Now, it's *very* important to understand how to use mathematical constructs (e.g. a rotation matrix, as Bubba said), but you aren't going to sit down and write a proof before you add matrix functionality to the next sweet game you all are writing out there.

12. My point exactly, Bob. I didn't take math classes just for all the cute asian chicks. Although, sometimes they were more memorable than the day's lesson. I always found it easier to grasp a mathematical concept by writing a program that utilizes that concept. Its always been my way of making something "click."

13. Originally Posted by master5001
My point exactly, Bob. I didn't take math classes just for all the cute asian chicks. Although, sometimes they were more memorable than the day's lesson. I always found it easier to grasp a mathematical concept by writing a program that utilizes that concept. Its always been my way of making something "click."
I don't have good 'conventional' maths skills, but I think so much like a coder I usually can just sit down and figure something out with a pen & paper and some good old-fashioned logic.

And regarding 'cheating' - I've built a rather substantial GDI-based 2D blitter + GUI widgets library that I wouldn't have had someone not posted an example of the BitBlt function (with PAINTSTRUCTS, DIB sections, etc) here. But I understand the code I was given, that's the main thing.

14. I don't think you need all that for game programming, unless you were trying to make a physics engine. I'm not saying that you shouldn't learn it eventually because Calculus is fascinating, but I haven't used an integral, nor a triple integral in game programming. That list just seems like it is the basic curriculum for all three college quarters of Calculus.

You also should go past Calc and include Linear Algebra, because of the integral part matrices play in graphics.