Hello! I will be starting college in a few weeks and I am majoring in Computer Science. I know that in order to complete my degree I will have to learn all sorts of math, but I was wondering what types of math are use a lot when developing games.

**0**

# What types of math are used a lot when developing games?

###
#2
GDNet+ - Reputation: **4609**

Posted 13 January 2014 - 01:23 PM

Honestly: It depends.

It depends a lot on the type of game you're making, as well as your role in the production, as well as what kind of tools you're working with.

If you're working with a good framework, you won't strictly speaking *need* to understand the math as well as if you're making your own stuff. That said, you do have to know when to apply the various functions you might have available to you.

Keep that in mind -- extensive knowledge of all of the following might be somewhat daunting. The more you know, though, the better you can apply the math to solve all kinds of things.

Linear algebra, trigonometry and vectors will be important in a lot of different areas.

Various statistics and probability can come in handy for different things, including balancing gameplay.

For 3D programming, you can expect to run into vector math even more -- dot and cross products, normals, etc. Trigonometry even more, including polar coordinates. Various math related to geometric shapes -- plane, ray and sphere equations.

Depending on what kind of frameworks you'll be using, some knowledge of matrix math will be useful.

For physics related things you might have to learn some physics (at least some formulas), e.g. ballistic trajectories. Calculus stuff.

You'll want to be comfortable with converting between radians and degrees.

---

There's probably a lot of areas I've missed, but I remember there being a similar post a while back. I'll go look for it.

**Project journal, check it out!**

http://www.gamedev.net/blog/1830-lactoses-journal/

Hello to all my stalkers.

###
#3
Members - Reputation: **311**

Posted 13 January 2014 - 01:23 PM

For working with 3D graphics Matrices are what you'll most likely be working with as they make complex problems relatively simple and are very powerful. Understanding trigonometry both in 3D and 2D space is quite helpful as well.

Depending on what you are doing in your game you can scale through lots of levels of math, but just remember you don't have to be a genius in math to program them. Formulas already exist and I think it's more important to know how to look at a concept or loose formula and implement it. Knowing the math makes it easier, but without doesn't make it impossible.

###
#4
GDNet+ - Reputation: **4609**

Posted 13 January 2014 - 01:30 PM

**Project journal, check it out!**

http://www.gamedev.net/blog/1830-lactoses-journal/

Hello to all my stalkers.

###
#6
GDNet+ - Reputation: **9938**

Posted 13 January 2014 - 01:43 PM

80% of game development by volume is basic algebra -- relatively simple expressions with a few constants and variables, sprinkled with basic operators (+, -, *, /, pow, sqrt). High school level stuff.

The other 20% by volume is comprised mostly of linear algebra, trigonometry, geometry, calculus, and statistics--roughly in that order in my experience--but the particular mix tends to vary depending on what your focus is. However, this 20% by volume accounts for a much higher percentage by utility and by difficulty. Its the stuff that makes things work elegantly or work at all. The more knowledge you have in these areas the better, but you can accomplish a great deal with just a solid understanding of the fundamentals--knowing more in these topics tends to let you see better solutions and make optimizations, but doesn't tend to be fundamentally limiting if you don't know more than the basics unless you have a very specialized focus.

Then, there are other mathematical topics that you might not apply directly, but which help you understand your systems better -- things like discreet math, algorithm analysis, and big-O notation. These are things that help you understand correctness and performance at a higher level, they give you the tools to make educated guesses about which of many potential approaches are better without having to implement and evaluate them. They also give you the tools to understand the root of a problem based on its mathematical symptoms -- things like numerical instability of floating point numbers under certain conditions, or performance regressions that result from new algorithms.

**Edited by Ravyne, 13 January 2014 - 01:44 PM.**

###
#7
Members - Reputation: **163**

Posted 14 January 2014 - 04:29 AM

Knowledge in vectors and matrices is a must. You may get away without a broad knowledge in matrices though. But more advanced features will need more mathematics. Linear algebra in general and calculus to some extent are very common.

**Edited by concept3d, 14 January 2014 - 04:29 AM.**

###
#9
GDNet+ - Reputation: **9938**

Posted 14 January 2014 - 01:02 PM

The moderators don't generally frown on duplicated content unless the topic is seriously over-served. Besides, The linked thread specifies 3D games, while this one doesn't specify -- there's a lot of overlap but the differences are not vanishingly small.

But I do agree that the linked thread has a lot of good discussion. Its worth reading.

###
#10
Moderators - Reputation: **26622**

Posted 14 January 2014 - 05:30 PM

Statistics has probably been my second most frequently used math. Coming up with permutations is common, as is ensuring things happen according to adjustable frequencies. Usually this isn't too hard, simple multiplication or data set manipulation, but you do need to understand the basics.

Calculus is used infrequently unless you are working on physics engines. Most people aren't working on physics engines, so you probably won't NEED it.. It is nice to have on occasion, but if you have the above skills you can usually get by without it.

Discrete mathematics is useful if you take it. All computing is discrete mathematics, there is no infinite precision inside the box.

Number theory can be useful to understand, but isn't really necessary.

There are college courses on fluid dynamics that some people might find useful.

Topology coursework might be useful to you, since most 3D models are representations of surfaces and topologies.

Business mathematics can be useful if you want to go into the business side of games. There are many business-oriented math topics, such as business calculus and business statistics, both focusing more on how to apply the math in a business environment.

From all of that, I recommend college algebra, a year of college calculus, college stats, and a year of college linear algebra. More if you have time in your schedule and if you have an interest in any topic.

I have heard many people complain about not having enough math background. I have never heard anyone seriously complain about knowing too much math. (I heard a few people joke about it because people were always coming to them to help with math problems in their code.) Computer science in many ways is applied mathematics. It is difficult to have too much knowledge.

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.