Equation of a straight line through 2 points online calculator. Equation of a line passing through two given points

Let two points be given M 1 (x 1,y 1) And M 2 (x 2,y 2). Let us write the equation of the line in the form (5), where k still unknown coefficient:

Since the point M 2 belongs to a given line, then its coordinates satisfy equation (5): . Expressing from here and substituting it into equation (5), we obtain the required equation:

If this equation can be rewritten in a form that is more convenient for memorization:

(6)

Example. Write down the equation of a straight line passing through points M 1 (1,2) and M 2 (-2,3)

Solution. . Using the property of proportion and performing the necessary transformations, we obtain the general equation of a straight line:

Angle between two straight lines

Consider two straight lines l 1 And l 2:

l 1: , , And

l 2: , ,

φ is the angle between them (). From Fig. 4 it is clear: .

From here , or

Using formula (7) you can determine one of the angles between straight lines. The second angle is equal to .

Example. Two straight lines are given by the equations y=2x+3 and y=-3x+2. find the angle between these lines.

Solution. From the equations it is clear that k 1 =2, and k 2 =-3. Substituting these values ​​into formula (7), we find

. Thus, the angle between these lines is equal to .

Conditions for parallelism and perpendicularity of two straight lines

If straight l 1 And l 2 are parallel, then φ=0 And tgφ=0. from formula (7) it follows that , whence k 2 =k 1. Thus, the condition for parallelism of two lines is the equality of their angular coefficients.

If straight l 1 And l 2 are perpendicular, then φ=π/2, α 2 = π/2+ α 1 . . Thus, the condition for the perpendicularity of two straight lines is that their angular coefficients are inverse in magnitude and opposite in sign.

Distance from point to line

Theorem. If a point M(x 0, y 0) is given, then the distance to the line Ax + Bу + C = 0 is determined as

Proof. Let point M 1 (x 1, y 1) be the base of the perpendicular dropped from point M to a given straight line. Then the distance between points M and M 1:

The coordinates x 1 and y 1 can be found by solving the system of equations:

The second equation of the system is the equation of a line passing through a given point M 0 perpendicular to a given line.

If we transform the first equation of the system to the form:

A(x – x 0) + B(y – y 0) + Ax 0 + By 0 + C = 0,

then, solving, we get:

Substituting these expressions into equation (1), we find:

The theorem has been proven.

Example. Determine the angle between the lines: y = -3x + 7; y = 2x + 1.

k 1 = -3; k 2 = 2 tanj= ; j = p/4.

Example. Show that the lines 3x – 5y + 7 = 0 and 10x + 6y – 3 = 0 are perpendicular.

We find: k 1 = 3/5, k 2 = -5/3, k 1 k 2 = -1, therefore, the lines are perpendicular.

Example. Given are the vertices of the triangle A(0; 1), B(6; 5), C(12; -1). Find the equation of the height drawn from vertex C.



We find the equation of side AB: ; 4x = 6y – 6;

2x – 3y + 3 = 0;

The required height equation has the form: Ax + By + C = 0 or y = kx + b.

k= . Then y = . Because height passes through point C, then its coordinates satisfy this equation: whence b = 17. Total: .

Answer: 3x + 2y – 34 = 0.

The distance from a point to a line is determined by the length of the perpendicular drawn from the point to the line.

If the line is parallel to the projection plane (h | | P 1), then in order to determine the distance from the point A to a straight line h it is necessary to lower the perpendicular from the point A to the horizontal h.

Let's consider a more complex example, when the straight line occupies a general position. Let it be necessary to determine the distance from a point M to a straight line A general position.

Determination task distances between parallel lines is solved similarly to the previous one. A point is taken on one line and a perpendicular is dropped from it to another line. The length of a perpendicular is equal to the distance between parallel lines.

Second order curve is a line defined by an equation of the second degree relative to the current Cartesian coordinates. In the general case, Ax 2 + 2Bxy + Su 2 + 2Dx + 2Ey + F = 0,



where A, B, C, D, E, F are real numbers and at least one of the numbers A 2 + B 2 + C 2 ≠0.

Circle

Circle center– this is the geometric locus of points in the plane equidistant from a point in the plane C(a,b).

The circle is given by the following equation:

Where x,y are the coordinates of an arbitrary point on the circle, R is the radius of the circle.

Sign of the equation of a circle

1. The term with x, y is missing

2. The coefficients for x 2 and y 2 are equal

Ellipse

Ellipse is called the geometric locus of points in a plane, the sum of the distances of each of which from two given points of this plane is called foci (a constant value).

The canonical equation of the ellipse:

X and y belong to the ellipse.

a – semimajor axis of the ellipse

b – semi-minor axis of the ellipse

The ellipse has 2 axes of symmetry OX and OU. The axes of symmetry of an ellipse are its axes, the point of their intersection is the center of the ellipse. The axis on which the foci are located is called focal axis. The point of intersection of the ellipse with the axes is the vertex of the ellipse.

Compression (tension) ratio: ε = s/a– eccentricity (characterizes the shape of the ellipse), the smaller it is, the less the ellipse is extended along the focal axis.

If the centers of the ellipse are not at the center C(α, β)

Hyperbola

Hyperbole is called the geometric locus of points in a plane, the absolute value of the difference in distances, each of which from two given points of this plane, called foci, is a constant value different from zero.

Canonical hyperbola equation

A hyperbola has 2 axes of symmetry:

a – real semi-axis of symmetry

b – imaginary semi-axis of symmetry

Asymptotes of a hyperbola:

Parabola

Parabola is the locus of points in the plane equidistant from a given point F, called the focus, and a given line, called the directrix.

The canonical equation of a parabola:

У 2 =2рх, where р is the distance from the focus to the directrix (parabola parameter)

If the vertex of the parabola is C (α, β), then the equation of the parabola (y-β) 2 = 2р(x-α)

If the focal axis is taken as the ordinate axis, then the equation of the parabola will take the form: x 2 =2qу

Let two points be given M(X 1 ,U 1) and N(X 2,y 2). Let's find the equation of the line passing through these points.

Since this line passes through the point M, then according to formula (1.13) its equation has the form

UY 1 = K(X–x 1),

Where K– unknown angular coefficient.

The value of this coefficient is determined from the condition that the desired straight line passes through the point N, which means its coordinates satisfy equation (1.13)

Y 2 – Y 1 = K(X 2 – X 1),

From here you can find the slope of this line:

,

Or after conversion

(1.14)

Formula (1.14) determines Equation of a line passing through two points M(X 1, Y 1) and N(X 2, Y 2).

In the special case when points M(A, 0), N(0, B), A ¹ 0, B¹ 0, lie on the coordinate axes, equation (1.14) will take a simpler form

Equation (1.15) called Equation of a straight line in segments, Here A And B denote the segments cut off by a straight line on the axes (Figure 1.6).

Figure 1.6

Example 1.10. Write an equation for a line passing through the points M(1, 2) and B(3, –1).

. According to (1.14), the equation of the desired line has the form

2(Y – 2) = -3(X – 1).

Transferring all terms to the left side, we finally obtain the desired equation

3X + 2Y – 7 = 0.

Example 1.11. Write an equation for a line passing through a point M(2, 1) and the point of intersection of the lines X+ Y – 1 = 0, X – y+ 2 = 0.

. We will find the coordinates of the point of intersection of the lines by solving these equations together

If we add these equations term by term, we get 2 X+ 1 = 0, whence . Substituting the found value into any equation, we find the value of the ordinate U:

Now let’s write the equation of the straight line passing through the points (2, 1) and:

or .

Hence or –5( Y – 1) = X – 2.

We finally obtain the equation of the desired line in the form X + 5Y – 7 = 0.

Example 1.12. Find the equation of the line passing through the points M(2.1) and N(2,3).

Using formula (1.14), we obtain the equation

It doesn't make sense since the second denominator is zero. From the conditions of the problem it is clear that the abscissas of both points have the same value. This means that the desired straight line is parallel to the axis OY and its equation is: x = 2.

Comment . If, when writing the equation of a line using formula (1.14), one of the denominators turns out to be equal to zero, then the desired equation can be obtained by equating the corresponding numerator to zero.

Let's consider other ways to define a line on a plane.

1. Let a non-zero vector be perpendicular to the given line L, and point M 0(X 0, Y 0) lies on this line (Figure 1.7).

Figure 1.7

Let's denote M(X, Y) any point on a line L. Vectors and Orthogonal. Using the conditions of orthogonality of these vectors, we obtain or A(XX 0) + B(YY 0) = 0.

We have obtained the equation of a line passing through a point M 0 is perpendicular to the vector. This vector is called Normal vector to a straight line L. The resulting equation can be rewritten as

Oh + Wu + WITH= 0, where WITH = –(AX 0 + By 0), (1.16),

Where A And IN– coordinates of the normal vector.

We obtain the general equation of the line in parametric form.

2. A straight line on a plane can be defined as follows: let a non-zero vector be parallel to the given straight line L and period M 0(X 0, Y 0) lies on this line. Let's take an arbitrary point again M(X, y) on a straight line (Figure 1.8).

Figure 1.8

Vectors and collinear.

Let us write down the condition for the collinearity of these vectors: , where T– an arbitrary number called a parameter. Let's write this equality in coordinates:

These equations are called Parametric equations Straight. Let us exclude the parameter from these equations T:

These equations can otherwise be written as

. (1.18)

The resulting equation is called The canonical equation of the line. The vector is called The directing vector is straight .

Comment . It is easy to see that if is the normal vector to the line L, then its direction vector can be the vector since , i.e. .

Example 1.13. Write the equation of a line passing through a point M 0(1, 1) parallel to line 3 X + 2U– 8 = 0.

Solution . The vector is the normal vector to the given and desired lines. Let's use the equation of a line passing through a point M 0 with a given normal vector 3( X –1) + 2(U– 1) = 0 or 3 X + – 5 = 0. We obtained the equation of the desired line.

Let the line pass through the points M 1 (x 1; y 1) and M 2 (x 2; y 2). The equation of a straight line passing through point M 1 has the form y-y 1 = k (x - x 1), (10.6)

Where k - still unknown coefficient.

Since the straight line passes through the point M 2 (x 2 y 2), the coordinates of this point must satisfy equation (10.6): y 2 -y 1 = k (x 2 - x 1).

From here we find Substituting the found value k into equation (10.6), we obtain the equation of a straight line passing through points M 1 and M 2:

It is assumed that in this equation x 1 ≠ x 2, y 1 ≠ y 2

If x 1 = x 2, then the straight line passing through the points M 1 (x 1,y I) and M 2 (x 2,y 2) is parallel to the ordinate axis. Its equation is x = x 1 .

If y 2 = y I, then the equation of the line can be written as y = y 1, the straight line M 1 M 2 is parallel to the abscissa axis.

Equation of a line in segments

Let the straight line intersect the Ox axis at point M 1 (a;0), and the Oy axis at point M 2 (0;b). The equation will take the form:
those.
. This equation is called equation of a straight line in segments, because numbers a and b indicate which segments the line cuts off on the coordinate axes.

Equation of a line passing through a given point perpendicular to a given vector

Let us find the equation of a straight line passing through a given point Mo (x O; y o) perpendicular to a given non-zero vector n = (A; B).

Let's take an arbitrary point M(x; y) on the line and consider the vector M 0 M (x - x 0; y - y o) (see Fig. 1). Since the vectors n and M o M are perpendicular, their scalar product is equal to zero: that is

A(x - xo) + B(y - yo) = 0. (10.8)

Equation (10.8) is called equation of a straight line passing through a given point perpendicular to a given vector .

Vector n= (A; B), perpendicular to the line, is called normal normal vector of this line .

Equation (10.8) can be rewritten as Ah + Wu + C = 0 , (10.9)

where A and B are the coordinates of the normal vector, C = -Ax o - Vu o is the free term. Equation (10.9) is the general equation of the line(see Fig. 2).

Fig.1 Fig.2

Canonical equations of the line

,

Where
- coordinates of the point through which the line passes, and
- direction vector.

Second order curves Circle

A circle is the set of all points of the plane equidistant from a given point, which is called the center.

Canonical equation of a circle of radius R centered at a point
:

In particular, if the center of the stake coincides with the origin of coordinates, then the equation will look like:

Ellipse

An ellipse is a set of points on a plane, the sum of the distances from each of which to two given points And , which are called foci, is a constant quantity
, greater than the distance between foci
.

The canonical equation of an ellipse whose foci lie on the Ox axis, and the origin of coordinates in the middle between the foci has the form
G de
a semi-major axis length; b – length of the semi-minor axis (Fig. 2).

Dependence between ellipse parameters
And is expressed by the ratio:

(4)

Ellipse eccentricitycalled the interfocal distance ratio2sto the major axis2a:

Headmistresses ellipse are straight lines parallel to the Oy axis, which are located at a distance from this axis. Directrix equations:
.

If in the equation of the ellipse
, then the foci of the ellipse are on the Oy axis.

So,

This article reveals the derivation of the equation of a straight line passing through two given points in a rectangular coordinate system located on a plane. Let us derive the equation of a straight line passing through two given points in a rectangular coordinate system. We will clearly show and solve several examples related to the material covered.

Before obtaining the equation of a line passing through two given points, it is necessary to pay attention to some facts. There is an axiom that says that through two divergent points on a plane it is possible to draw a straight line and only one. In other words, two given points on a plane are defined by a straight line passing through these points.

If the plane is defined by the rectangular coordinate system Oxy, then any straight line depicted in it will correspond to the equation of a straight line on the plane. There is also a connection with the directing vector of the straight line. This data is sufficient to compile the equation of a straight line passing through two given points.

Let's look at an example of solving a similar problem. It is necessary to create an equation for a straight line a passing through two divergent points M 1 (x 1, y 1) and M 2 (x 2, y 2), located in the Cartesian coordinate system.

In the canonical equation of a line on a plane, having the form x - x 1 a x = y - y 1 a y, a rectangular coordinate system O x y is specified with a line that intersects with it at a point with coordinates M 1 (x 1, y 1) with a guide vector a → = (a x , a y) .

It is necessary to create a canonical equation of a straight line a, which will pass through two points with coordinates M 1 (x 1, y 1) and M 2 (x 2, y 2).

Straight a has a direction vector M 1 M 2 → with coordinates (x 2 - x 1, y 2 - y 1), since it intersects the points M 1 and M 2. We have obtained the necessary data in order to transform the canonical equation with the coordinates of the direction vector M 1 M 2 → = (x 2 - x 1, y 2 - y 1) and the coordinates of the points M 1 lying on them (x 1, y 1) and M 2 (x 2 , y 2) . We obtain an equation of the form x - x 1 x 2 - x 1 = y - y 1 y 2 - y 1 or x - x 2 x 2 - x 1 = y - y 2 y 2 - y 1.

Consider the figure below.

Following the calculations, we write down the parametric equations of a line on a plane that passes through two points with coordinates M 1 (x 1, y 1) and M 2 (x 2, y 2). We obtain an equation of the form x = x 1 + (x 2 - x 1) · λ y = y 1 + (y 2 - y 1) · λ or x = x 2 + (x 2 - x 1) · λ y = y 2 + (y 2 - y 1) · λ .

Let's take a closer look at solving several examples.

Example 1

Write down the equation of a straight line passing through 2 given points with coordinates M 1 - 5, 2 3, M 2 1, - 1 6.

Solution

The canonical equation for a line intersecting at two points with coordinates x 1, y 1 and x 2, y 2 takes the form x - x 1 x 2 - x 1 = y - y 1 y 2 - y 1. According to the conditions of the problem, we have that x 1 = - 5, y 1 = 2 3, x 2 = 1, y 2 = - 1 6. It is necessary to substitute the numerical values ​​into the equation x - x 1 x 2 - x 1 = y - y 1 y 2 - y 1. From here we get that the canonical equation takes the form x - (- 5) 1 - (- 5) = y - 2 3 - 1 6 - 2 3 ⇔ x + 5 6 = y - 2 3 - 5 6.

Answer: x + 5 6 = y - 2 3 - 5 6.

If you need to solve a problem with a different type of equation, then first you can go to the canonical one, since it is easier to come from it to any other one.

Example 2

Compose the general equation of a straight line passing through points with coordinates M 1 (1, 1) and M 2 (4, 2) in the O x y coordinate system.

Solution

First, you need to write down the canonical equation of a given line that passes through given two points. We get an equation of the form x - 1 4 - 1 = y - 1 2 - 1 ⇔ x - 1 3 = y - 1 1 .

Let's bring the canonical equation to the desired form, then we get:

x - 1 3 = y - 1 1 ⇔ 1 x - 1 = 3 y - 1 ⇔ x - 3 y + 2 = 0

Answer: x - 3 y + 2 = 0 .

Examples of such tasks were discussed in school textbooks during algebra lessons. School problems differed in that the equation of a straight line with an angle coefficient was known, having the form y = k x + b. If you need to find the value of the slope k and the number b for which the equation y = k x + b defines a line in the O x y system that passes through the points M 1 (x 1, y 1) and M 2 (x 2, y 2) , where x 1 ≠ x 2. When x 1 = x 2 , then the angular coefficient takes on the value of infinity, and the straight line M 1 M 2 is defined by a general incomplete equation of the form x - x 1 = 0 .

Because the points M 1 And M 2 are on a straight line, then their coordinates satisfy the equation y 1 = k x 1 + b and y 2 = k x 2 + b. It is necessary to solve the system of equations y 1 = k x 1 + b y 2 = k x 2 + b for k and b.

To do this, we find k = y 2 - y 1 x 2 - x 1 b = y 1 - y 2 - y 1 x 2 - x 1 x 1 or k = y 2 - y 1 x 2 - x 1 b = y 2 - y 2 - y 1 x 2 - x 1 x 2 .

With these values ​​of k and b, the equation of a line passing through the given two points becomes y = y 2 - y 1 x 2 - x 1 x + y 2 - y 2 - y 1 x 2 - x 1 x 1 or y = y 2 - y 1 x 2 - x 1 x + y 2 - y 2 - y 1 x 2 - x 1 x 2.

It is impossible to remember such a huge number of formulas at once. To do this, it is necessary to increase the number of repetitions in solving problems.

Example 3

Write down the equation of a straight line with an angular coefficient passing through points with coordinates M 2 (2, 1) and y = k x + b.

Solution

To solve the problem, we use a formula with an angular coefficient of the form y = k x + b. The coefficients k and b must take such a value that this equation corresponds to a straight line passing through two points with coordinates M 1 (- 7, - 5) and M 2 (2, 1).

Points M 1 And M 2 are located on a straight line, then their coordinates must make the equation y = k x + b a true equality. From this we get that - 5 = k · (- 7) + b and 1 = k · 2 + b. Let's combine the equation into the system - 5 = k · - 7 + b 1 = k · 2 + b and solve.

Upon substitution we get that

5 = k · - 7 + b 1 = k · 2 + b ⇔ b = - 5 + 7 k 2 k + b = 1 ⇔ b = - 5 + 7 k 2 k - 5 + 7 k = 1 ⇔ ⇔ b = - 5 + 7 k k = 2 3 ⇔ b = - 5 + 7 2 3 k = 2 3 ⇔ b = - 1 3 k = 2 3

Now the values ​​k = 2 3 and b = - 1 3 are substituted into the equation y = k x + b. We find that the required equation passing through the given points will be an equation of the form y = 2 3 x - 1 3 .

This method of solution predetermines the waste of a lot of time. There is a way in which the task is solved in literally two steps.

Let us write the canonical equation of the line passing through M 2 (2, 1) and M 1 (- 7, - 5), having the form x - (- 7) 2 - (- 7) = y - (- 5) 1 - (- 5) ⇔ x + 7 9 = y + 5 6 .

Now let's move on to the slope equation. We get that: x + 7 9 = y + 5 6 ⇔ 6 · (x + 7) = 9 · (y + 5) ⇔ y = 2 3 x - 1 3.

Answer: y = 2 3 x - 1 3 .

If in three-dimensional space there is a rectangular coordinate system O x y z with two given non-coinciding points with coordinates M 1 (x 1, y 1, z 1) and M 2 (x 2, y 2, z 2), the straight line M passing through them 1 M 2 , it is necessary to obtain the equation of this line.

We have that canonical equations of the form x - x 1 a x = y - y 1 a y = z - z 1 a z and parametric equations of the form x = x 1 + a x · λ y = y 1 + a y · λ z = z 1 + a z · λ are able to define a line in the coordinate system O x y z, passing through points having coordinates (x 1, y 1, z 1) with a direction vector a → = (a x, a y, a z).

Straight M 1 M 2 has a direction vector of the form M 1 M 2 → = (x 2 - x 1, y 2 - y 1, z 2 - z 1), where the straight line passes through the point M 1 (x 1, y 1, z 1) and M 2 (x 2 , y 2 , z 2), hence the canonical equation can be of the form x - x 1 x 2 - x 1 = y - y 1 y 2 - y 1 = z - z 1 z 2 - z 1 or x - x 2 x 2 - x 1 = y - y 2 y 2 - y 1 = z - z 2 z 2 - z 1, in turn parametric x = x 1 + (x 2 - x 1) λ y = y 1 + (y 2 - y 1) λ z = z 1 + (z 2 - z 1) λ or x = x 2 + (x 2 - x 1) λ y = y 2 + (y 2 - y 1) · λ z = z 2 + (z 2 - z 1) · λ .

Consider a drawing that shows 2 given points in space and the equation of a straight line.

Example 4

Write the equation of a line defined in a rectangular coordinate system O x y z of three-dimensional space, passing through given two points with coordinates M 1 (2, - 3, 0) and M 2 (1, - 3, - 5).

Solution

It is necessary to find the canonical equation. Since we are talking about three-dimensional space, it means that when a line passes through given points, the desired canonical equation will take the form x - x 1 x 2 - x 1 = y - y 1 y 2 - y 1 = z - z 1 z 2 - z 1 .

By condition we have that x 1 = 2, y 1 = - 3, z 1 = 0, x 2 = 1, y 2 = - 3, z 2 = - 5. It follows that the necessary equations will be written as follows:

x - 2 1 - 2 = y - (- 3) - 3 - (- 3) = z - 0 - 5 - 0 ⇔ x - 2 - 1 = y + 3 0 = z - 5

Answer: x - 2 - 1 = y + 3 0 = z - 5.

If you notice an error in the text, please highlight it and press Ctrl+Enter

Let's look at how to create an equation for a line passing through two points using examples.

Example 1.

Write an equation for a straight line passing through points A(-3; 9) and B(2;-1).

Method 1 - create an equation of a straight line with an angle coefficient.

The equation of a straight line with an angular coefficient has the form . Substituting the coordinates of points A and B into the equation of the straight line (x= -3 and y=9 - in the first case, x=2 and y= -1 - in the second), we obtain a system of equations from which we find the values ​​of k and b:

Adding the 1st and 2nd equations term by term, we get: -10=5k, whence k= -2. Substituting k= -2 into the second equation, we find b: -1=2·(-2)+b, b=3.

Thus, y= -2x+3 is the required equation.

Method 2 - let's create a general equation of a straight line.

The general equation of a straight line has the form . Substituting the coordinates of points A and B into the equation, we obtain the system:

Since the number of unknowns is greater than the number of equations, the system is not solvable. But all variables can be expressed through one. For example, through b.

By multiplying the first equation of the system by -1 and adding term by term with the second:

we get: 5a-10b=0. Hence a=2b.

Let's substitute the resulting expression into the second equation: 2·2b -b+c=0; 3b+c=0; c= -3b.
Substitute a=2b, c= -3b into the equation ax+by+c=0:

2bx+by-3b=0. It remains to divide both sides by b:

The general equation of a straight line can easily be reduced to the equation of a straight line with an angular coefficient:

Method 3 - create an equation of a straight line passing through 2 points.

The equation of a line passing through two points is:

Let's substitute the coordinates of points A(-3; 9) and B(2;-1) into this equation

(that is, x 1 = -3, y 1 =9, x 2 =2, y 2 = -1):

and simplify:

whence 2x+y-3=0.

In school courses, the equation of a straight line with an angle coefficient is most often used. But the easiest way is to derive and use the formula for the equation of a line passing through two points.

Comment.

If, when substituting the coordinates of given points, one of the denominators of the equation

turns out to be equal to zero, then the required equation is obtained by equating the corresponding numerator to zero.

Example 2.

Write an equation for a straight line passing through two points C(5; -2) and D(7;-2).

We substitute the coordinates of points C and D into the equation of a straight line passing through 2 points.

Share