Defining lines, segments, and rays
What most people call a line is a line segment. A line segment is just a piece of a line. By true mathematical definition, a line continues infinitely. In Chapter 2, Let’s Start Drawing, we used the equation for a line to draw segments between mouse clicks in our project window. Recall that the following equation was used:
y = mx + c
Here, m is the gradient (or slope) and c is the y-intercept, as shown in Figure 10.1:
Figure 10.1: The gradient and y-intercept
The value of y can be calculated for infinite values of x and vice versa, making a line continuous. However, a line segment has a start and end, as illustrated in Figure 10.2:
Figure 10.2: Differing straight geometrics
To clarify the difference between these straight geometrics, let’s examine their properties:
- A vector has a magnitude and direction, as we discovered in Chapter 9, Practicing Vector Essentials. It doesn...