Game Development Reference
In-Depth Information
Chapter 7
Polar Coordinate Systems
First of all, we must note that the universe is spherical.
— Nicolaus Copernicus (1473-1543)
The Cartesian coordinate system isn't the only system for mapping out
space and defining locations precisely. An alternative to the Cartesian
system is the polar coordinate system, which is the subject of this chapter.
If you're not very familiar with polar coordinates, it might seem like an
esoteric or advanced topic (especially because of the trig), and you might be
tempted to gloss over. Please don't make this mistake. There are many very
practical problems in areas such as AI and camera control whose solutions
(and inherent di culties!) can be readily understood in the framework of
polar coordinates.
This chapter is organized into the following sections:
Section 7.1 describes 2D polar coordinates.
Section 7.2 gives some examples where polar coordinates are prefer-
able to Cartesian coordinates.
Section 7.3 shows how polar space works in 3D and introduces cylin-
drical and spherical coordinates.
Finally, Section 7.4 makes it clear that polar space can be used to
describe vectors as well as positions.
7.1
2D Polar Space
This section introduces the basic idea behind polar coordinates, using two
dimensions to get us warmed up. Section 7.1.1 shows how to use polar
coordinates to describe position. Section 7.1.2 discusses aliasing of polar
coordinates. Section 7.1.3 shows how to convert between polar and Carte-
sian coordinates in 2D.
191
 
Search WWH ::




Custom Search