We shall see that it is sometimes advantageous to represent a line in the plane using four numbers, namely two vectors (with two components apiece), namely a position vector and a direction vector.
As a bonus, this approach allows us to represent not just the line as a whole, but also a special “anchor point” on the line. This is sometimes useful, e.g. to represent the “current” point or the “starting” point or some such.
For example, the point where two lines intersect is given by:
The two expressions (equation 1a and equation 1b) are equivalent; you don’t need to evaluate both. The notation is explained in section 4.
Finding the intersection of two lines is a topic for high-school algebra, except that they do it without using vectors. In contrast, the last 999 times I wanted to find an intersection, the problem was already formulated in terms of vectors, and equation 1 was by far the most convenient way to proceed.
For example, suppose point A is a navigation fix or beacon, dA is a particular radial passing through that fix, B is your current position, and dB is your current velocity vector (aka heading). An autopilot or flight simulator might need to calculate the point of intersection, to predict where your path crosses the radial. (The actual calculation is more complicated than that, but even so, calculating intersections is one of the crucial ingredients.)
A spreadsheet that implements this calculation is given in reference 1.
By way of context and background, here are some other representations that are sometimes encountered:
Similarly, you can use the x-intercept and the inverse slope. This fails for horizontal lines.
Even though it “should” take only three numbers to represent a line with an anchor point, it is sometimes convenient to use four numbers, namely two vectors with two components apiece, namely a position vector (to specify the anchor point) and a direction vector (to specify the rest of the line).
where θ is the heading, measured clockwise from north. Note: Mathematicians measure directions counterclockwise from east. In contrast, navigators measure headings clockwise from north, which is the convention used in equation 3.
Conceptually, we still require only three numbers, because we can impose a constraint. Without loss of generality, we can require the direction vector to be a unit vector, by setting |v|=1 in the last line of of equation 3.
On the other hand, sometimes it is advantageous to think in terms of a velocity vector (rather than a direction vector), in which case we really do need four numbers (two vectors) to specify what’s going on. Things get weird if the velocity is zero, in which case the heading is undefined and we don’t have a line at all; instead we just have an isolated point.
Suppose we have two lines:
for all α and β. To find the intersection, we need to find values of α and β such that
this is a vector equation, so it counts as two equations in two unknowns, so it is well-posed (provided the two lines are not parallel).
We can convert this into a pair of scalar equations as follows:
where pA is a vector formed by rotating dA by 90 degrees. We then solve:
So the intersection occurs at:
We can improve our understanding of this by performing some simple checks:
Similar logic applies to Equation 9b.
The expression for X−A is hauntingly similar (but not identical) to a projection operator acting on B−A. Using Dirac bra-ket notation to distingish row vectors from column vectors, we have:
If nothing else, this makes it easy to remember the formula. The pattern is:
(The other direction vector in the numerator, namely ⟨pB|, gets dotted into |B−A⟩, so it does not contribute to the direction of the overall expression.)
There’s probably an elegant geometrical interpretation of this operator, i.e. some concept that captures the general notion of outer product divided by inner product, including projection operators as a special case.... However, I’m not grasping the general case at the moment.