Trigonometry and Game Development
In game development, there are a lot of situations where you need to use the trigonometric functions. When programming a game, you'll often need to do things like find the distance between two points or make an object move. Here are a few examples:
Rotating a spaceship or other vehicle
Properly handling the trajectory of projectiles shot from a rotated weapon
Calculating a new trajectory after a collision between two objects such as billiard balls or heads
Determining if a collision between two objects is happening
Finding the angle of trajectory (given the speed of an object in the x direction and y direction)
Here's a good link to different areas of Math required in various types of video game development.
Check these links for further reading:
Camera field of view: 3D projections & trigonometry
Trigonometry for Flash Game Design
The most obvious use of trigonometry is to get an object to move in any given direction, without trigonometry this is impossible.
//Example code, will move the object speed units in the given direction (degrees)
d2r = pi / 180; //Conversion from degrees to radians
this.x += speed * cos (direction * d2r);
this.y += speed *-sin (direction * d2r);
It is also used for other things, such as:
- Executing transformations on 2d sprites to create rotation.
- Is used very extensively in projecting a 3d view.
- Due to the shape of a sine wave it can be used to create smooth transitions between 2 values.
- Creating sine waves for the purpose of audio synthesis.
- Drawing circular objects such as circles and spheres.
- Determining the location of a point which is on the arm of a pivot.
3D models are defined by vertices (numeric lists of coordinate pairs or triplets in 3D space), and lines that connect them. Those lines make surfaces that can be rendered, lit, textured, etc.
In order to, say, rotate an object, you have to be able to manipulate those vertices. If you want to rotate an object some number of degrees or radians, you'll have to use trig functions to figure out where it winds up.
Basic trig is fundamental to ANY 3D manipulation required for games, simulation etc. It's worth your time to investigate and become familiar with the real meaning of those functions, their limitations, and how they apply to and amplify the usefulness of geometry, signals processing, etc.
This is a great question; most just nod and act like it's obvious. Unless your first name is Blaise or Renee, it's probably not.