Game Development Reference
In-Depth Information
The Distance Between Points
To take the preceding discussion a step further, consider once again the distance
between two points on a line. In Figure 7.1, you establish a relationship between
two ordered pairs, (4, 9) and (1, 5). As the figure reveals, the distance between the
two points can be viewed in terms of the differences between the corresponding
elements of the two ordered pairs. Accordingly, the difference between 9 and 5 is
4 and the difference between 4 and 1 is 3. The figure uses the delta character to
show this difference (or change).
Applying the Pythagorean Theorem
The two points in Figure 7.1 define two of three points in a triangle. The difference
between the corresponding x values of the two points gives you the distance that
defines the base of the triangle. The difference between the corresponding y values
Figure 7.1
The change in the rise is 4 and the change in the run is 3.
Search WWH ::




Custom Search