Game Development Reference
In-Depth Information
7.1.1 Locating Points by Using 2D Polar Coordinates
Remember that a 2D Cartesian coordinate space has an origin, which estab-
lishes the position of the coordinate space, and two axes that pass through
the origin, which establish the orientation of the space. A 2D polar coor-
dinate space also has an origin (known as the pole), which has the same
basic purpose—it defines the “center” of the coordinate space. A polar co-
ordinate space has only one axis, however, sometimes called the polar axis,
which is usually depicted as a ray from the origin. It is customary in math
literature for the polar axis to point to the right in diagrams, and thus it
corresponds to the +x axis in a Cartesian system, as shown in Figure 7.1.
Figure 7.1
A 2D polar coordinate space
It's often convenient to use different conventions than this, as shown in
Section 7.3.3. Until then, our discussion adopts the traditional conventions
of the math literature.
In the Cartesian coordinate system, we described a 2D point using two
signed distances, x and y. The polar coordinate system uses one distance
and one angle. By convention, the distance is usually assigned to the vari-
able r (which is short for “radius”) and the angle is usually called θ. The
polar coordinate pair (r,θ) specifies a point in 2D space as follows:
Step 1. Start at the origin, facing in the direction of the polar axis, and
rotate by the angle θ. Positive values of θ are usually interpreted
to mean counterclockwise rotation, negative values mean clockwise
rotation.
Locating the point
described by 2D polar
coordinates (r, θ)
 
Search WWH ::




Custom Search