Calculation of the angle between lines on the plane and in space: formula

A typical geometric problem is to find the angle between the lines. On the plane, if the equations of lines are known, they can be drawn and the angle measured by a protractor. However, this method is laborious and not always possible. To know the named angle, it is not necessary to draw straight lines, it can be calculated. How this is done, this article will answer.

Line and its vector equation

Straight on the plane

Any line can be represented as a vector that starts at -∞ and ends at + ∞. In this case, the vector passes through some point in space. Thus, all vectors that can be drawn between any two points of the line will be parallel to each other. This definition allows you to set the equation of a line in a vector form:

(x; y; z) = (x 0 ; y 0 ; z 0 ) + α * (a; b; c)

Here, the vector with coordinates (a; b; c) is a guide for this line passing through the point (x 0 ; y 0 ; z 0 ). The parameter α allows you to translate the specified point to any other for this line. This equation is intuitive and easy to work with in both three-dimensional space and on the plane. For a plane, it will not contain the z coordinates and the third component of the guide vector.

Straight in space

The convenience of performing calculations and studying the mutual position of the lines due to the use of the vector equation is due to the fact that its directing vector is known. Its coordinates are used to calculate the angle between the lines and the distance between them.

The general equation for a straight line on a plane

We explicitly write the vector equation of the line for the two-dimensional case. It has the form:

x = x 0 + α * a;

y = y 0 + α * b

Now we calculate the parameter α for each equality and equate the right-hand sides of the obtained equalities:

α = (x - x 0 ) / a;

α = (y - y 0 ) / b;

(x - x 0 ) / a = (y - y 0 ) / b

Opening the brackets and transferring all the terms in one direction of equality, we obtain:

1 / a * x + (- 1 / b) * y + y 0 / b- x 0 / a = 0 =>

A * x + B * y + C = 0, where A = 1 / a, B = -1 / b, C = y 0 / b- x 0 / a

The resulting expression is called a general equation for a straight line defined in two-dimensional space (in three-dimensional, this equation corresponds to a plane z axis parallel to the plane, and not a straight line).

If we explicitly write y through x in this expression, we get the following form, known to every student:

y = k * x + p, where k = -A / B, p = -C / B

This linear equation uniquely sets a line on the plane. To draw it according to the well-known equation is very simple, for this it is necessary to put x = 0 and y = 0 in turn, mark the corresponding points in the coordinate system and draw a straight line connecting the obtained points.

Formula of the angle between the lines

Intersecting straight lines

On a plane, two lines can either intersect or be parallel to each other. In space, the possibility of the intersection of straight lines is also added to these options. Whatever variant of the relative position of these one-dimensional geometric objects is realized, the angle between them can always be determined by the following formula:

φ = arccos (| (v 1 ¯ * v 2 ¯) | / (| v 1 ¯ | * | v 2 ¯ |))

Where v 1 ¯ and v 2 ¯ are directing vectors for line 1 and 2, respectively. The numerator is a scalar product module to exclude obtuse angles and take into account only sharp ones.

The vectors v 1 ¯ and v 2 ¯ can be specified by two or three coordinates, while the formula for the angle φ remains unchanged.

Parallelism and perpendicularity of straight lines

Parallel lines

If the angle between 2 lines calculated by the formula above is 0 o , then they are said to be parallel. To determine whether the lines are parallel or not, you can not calculate the angle φ, it is enough to show that one directing vector can be represented through a similar vector to another straight line, that is:

v 1 ¯ = q * v 2 ¯

Here q is some real number.

If the equations of lines are given in the form:

y = k 1 * x + p 1,

y = k 2 * x + p 2,

then they will be parallel only when the coefficients at x are equal, that is:

k 1 = k 2

This fact can be proved if we consider how the coefficient k is expressed in terms of the coordinates of the directing vector of the line.

If the angle of intersection between the lines is 90 o , then they are called perpendicular. To determine the perpendicularity of the lines, it is also not necessary to calculate the angle φ; for this, it is sufficient to calculate only the scalar product of the vectors v 1 ¯ and v 2 ¯. It should be zero.

In the case of intersecting straight lines in space, the formula for the angle φ can also be used. In this case, the result should be correctly interpreted. The calculated φ shows the angle between the directing vectors of the lines that do not intersect and are not parallel.

Task number 1. Perpendicular straight lines

Perpendicular straight lines

It is known that the equations of lines have the form:

(x; y) = (1; 2) + α * (1; 2);

(x; y) = (-4; 7) + β * (- 4; 2)

It is necessary to determine whether these lines are perpendicular.

As mentioned above, to answer the question, it suffices to calculate the scalar product of the vectors of the guides, which correspond to the coordinates (1; 2) and (-4; 2). We have:

(1; 2) * (- 4; 2) = 1 * (- 4) + 2 * 2 = 0

Since we got 0, this means that the lines in question intersect at right angles, that is, they are perpendicular.

Task number 2. Line intersection angle

It is known that two equations for lines have the following form:

y = 2 * x - 1;

y = -x + 3

It is necessary to find the angle between the lines.

Since the coefficients at x have different values, these lines are not parallel. To find the angle that forms when they intersect, we translate each of the equations into a vector form.

For the first line we get:

(x; y) = (x; 2 * x - 1)

On the right side of the equality, we have a vector whose coordinates depend on x. We represent it as the sum of two vectors, and the coordinates of the first will contain the variable x, and the coordinates of the second will consist exclusively of numbers:

(x; y) = (x; 2 * x) + (0; - 1) = x * (1; 2) + (0; - 1)

Since x takes arbitrary values, it can be replaced by the parameter α. The vector equation for the first line takes the form:

(x; y) = (0; - 1) + α * (1; 2)

We do the same actions with the second equation of the line, we get:

(x; y) = (x; -x + 3) = (x; -x) + (0; 3) = x * (1; -1) + (0; 3) =>

(x; y) = (0; 3) + β * (1; -1)

We rewrote the original equations in vector form. Now you can use the formula for the angle of intersection, substituting the coordinates of the directing vectors of the lines into it:

(1; 2) * (1; -1) = -1;

| (1; 2) | = √5;

| (1; -1) | = √2;

φ = arccos (| -1 | / (√5 * √2)) = 71.565 o

Thus, the considered lines intersect at an angle of 71.565 o , or 1.249 radians.

This problem could be solved differently. To do this, take two arbitrary points of each line, compose the direction vectors from them, and then use the formula for φ.


All Articles