Game Development Reference
In-Depth Information
Figure 7.3
The multiplicative inverse of the slope allows you to generate a perpendicular line.
As Figure 7.3 indicates, the y-intercept for this line is (0, 4). If you solve the
equation for the point at which the line crosses the x axis, you arrive at (6, 0). If
you set x to 3 for this equation, you find that the value of y is 2.
To create a perpendicular line beginning at the coordinate (3, 2), you can an add
2 to the run value and 3 to the rise value. In other words, you invert the values
you obtain from the original slope, and then add them to the original slope. This
gives you a point at (5, 5). Now you draw a line from the your initial set of
coordinates to your new set of coordinates. You can then find a slope for the new
line. You proceed along this path:
y 2 y 1
5 2
5 3 ¼
3
2
m ¼
x 2 x 1 ¼
 
Search WWH ::




Custom Search