O'Reilly logo

Beginning Math and Physics for Game Programmers by Wendy Stahler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Trigonometric Functions

The trigonometric functions often surface in game programming. Any time you model a scenario with a right triangle (which happens often on a gridlike screen), the trig functions come in handy. We'll also use them in the vector chapter (Chapter 4) and again in all the 2D and 3D physics chapters. In addition, we'll look at the graphs of sine and cosine, because they can be used for any kind of oscillating (wavelike) motion. But before we get too carried away, let's define these functions from scratch.

The trigonometric functions are all defined in terms of a right triangle; they're really just relationships between two of the three sides. Look at the triangle shown in Figure 3.4. It's a right triangle, so you can use it ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required