The smallest angle between the non-perpendicular lines and can be found using the formula
A generation ago, this formula used to be taught in a typical Precalculus class (or, as it was called back then, analytical geometry). However, I find that analytic geometry has fallen out of favor in modern Precalculus courses.
Why does this formula work? Consider the graphs of and , and let’s measure the angle that the line makes with the positive axis.
The lines and are parallel, and the axis is a transversal intersecting these two parallel lines. Therefore, the angles that both lines make with the positive axis are congruent. In other words, the is entirely superfluous to finding the angle . The important thing that matters is the slope of the line, not where the line intersects the axis.
The point lies on the line , which also passes through the origin. By definition of tangent, can be found by dividing the and coordinates:
We now turn to the problem of finding the angle between two lines. As noted above, the intercepts do not matter, and so we only need to find the smallest angle between the lines and .
The angle will either be equal to or , depending on the values of and . Let’s now compute both and using the formula for the difference of two angles:
Since the smallest angle must lie between and , the value of must be positive (or undefined if … for now, we’ll ignore this special case). Therefore, whichever of the above two lines holds, it must be that
We now use the fact that and :
The above formula only applies to non-perpendicular lines. However, the perpendicular case may be remembered as almost a special case of the above formula. After all, is undefined at , and the right hand side is also undefined if . This matches the theorem that the two lines are perpendicular if and only if , or that the slopes of the two lines are negative reciprocals.