Biographies Characteristics Analysis

Parametric equation of a straight line online. Equation of a straight line on a plane

Lesson from the series “Geometric algorithms”

Hello dear reader!

Today we will start learning algorithms related to geometry. The fact is that there are quite a lot of Olympiad problems in computer science related to computational geometry, and solving such problems often causes difficulties.

Over the course of several lessons, we will consider a number of elementary subtasks on which the solution of most problems in computational geometry is based.

In this lesson we will create a program for finding the equation of a line, passing through given two points. To solve geometric problems, we need some knowledge of computational geometry. We will devote part of the lesson to getting to know them.

Insights from Computational Geometry

Computational geometry is a branch of computer science that studies algorithms for solving geometric problems.

The initial data for such problems can be a set of points on a plane, a set of segments, a polygon (specified, for example, by a list of its vertices in clockwise order), etc.

The result can be either an answer to some question (such as does a point belong to a segment, do two segments intersect, ...), or some geometric object (for example, the smallest convex polygon connecting given points, the area of ​​a polygon, etc.) .

We will consider problems of computational geometry only on the plane and only in the Cartesian coordinate system.

Vectors and coordinates

To apply the methods of computational geometry, it is necessary to translate geometric images into the language of numbers. We will assume that the plane is given a Cartesian coordinate system, in which the direction of rotation counterclockwise is called positive.

Now geometric objects receive an analytical expression. So, to specify a point, it is enough to indicate its coordinates: a pair of numbers (x; y). A segment can be specified by specifying the coordinates of its ends; a straight line can be specified by specifying the coordinates of a pair of its points.

But our main tool for solving problems will be vectors. Let me therefore recall some information about them.

Line segment AB, which has a point A is considered the beginning (point of application), and the point IN– end, called a vector AB and is denoted by either or by a bold lowercase letter, for example A .

To denote the length of a vector (that is, the length of the corresponding segment), we will use the modulus symbol (for example, ).

An arbitrary vector will have coordinates equal to the difference between the corresponding coordinates of its end and beginning:

,

here are the points A And B have coordinates respectively.

For calculations we will use the concept oriented angle, that is, an angle that takes into account the relative position of the vectors.

Oriented angle between vectors a And b positive if the rotation is from the vector a to vector b is performed in a positive direction (counterclockwise) and negative in the other case. See Fig.1a, Fig.1b. It is also said that a pair of vectors a And b positively (negatively) oriented.

Thus, the value of the oriented angle depends on the order in which the vectors are listed and can take values ​​in the interval.

Many problems in computational geometry use the concept of vector (skew or pseudoscalar) products of vectors.

The vector product of vectors a and b is the product of the lengths of these vectors and the sine of the angle between them:

.

Cross product of vectors in coordinates:

The expression on the right is a second-order determinant:

Unlike the definition given in analytical geometry, it is a scalar.

The sign of the vector product determines the position of the vectors relative to each other:

a And b positively oriented.

If the value is , then a pair of vectors a And b negatively oriented.

The cross product of nonzero vectors is zero if and only if they are collinear ( ). This means that they lie on the same line or on parallel lines.

Let's look at a few simple problems that are necessary when solving more complex ones.

Let's determine the equation of a straight line from the coordinates of two points.

Equation of a line passing through two different points specified by their coordinates.

Let two non-coinciding points be given on a straight line: with coordinates (x1; y1) and with coordinates (x2; y2). Accordingly, a vector with a beginning at a point and an end at a point has coordinates (x2-x1, y2-y1). If P(x, y) is an arbitrary point on our line, then the coordinates of the vector are equal to (x-x1, y – y1).

Using the vector product, the condition for collinearity of vectors and can be written as follows:

Those. (x-x1)(y2-y1)-(y-y1)(x2-x1)=0

(y2-y1)x + (x1-x2)y + x1(y1-y2) + y1(x2-x1) = 0

We rewrite the last equation as follows:

ax + by + c = 0, (1)

c = x1(y1-y2) + y1(x2-x1)

So, the straight line can be specified by an equation of the form (1).

Problem 1. The coordinates of two points are given. Find its representation in the form ax + by + c = 0.

In this lesson we learned some information about computational geometry. We solved the problem of finding the equation of a line from the coordinates of two points.

In the next lesson, we will create a program to find the intersection point of two lines given by our equations.

Equation of a line on a plane.

As is known, any point on the plane is determined by two coordinates in some coordinate system. Coordinate systems can be different depending on the choice of basis and origin.

Definition. Line equation is called the relation y = f(x) between the coordinates of the points that make up this line.

Note that the equation of a line can be expressed parametrically, that is, each coordinate of each point is expressed through some independent parameter t.

A typical example is the trajectory of a moving point. In this case, the role of the parameter is played by time.

Equation of a straight line on a plane.

Definition. Any straight line on the plane can be specified by a first-order equation

Ax + Wu + C = 0,

Moreover, the constants A and B are not equal to zero at the same time, i.e. A 2 + B 2  0. This first order equation is called general equation of a straight line.

Depending on the values ​​of constants A, B and C, the following special cases are possible:

    C = 0, A  0, B  0 – the straight line passes through the origin

    A = 0, B  0, C  0 (By + C = 0) - straight line parallel to the Ox axis

    B = 0, A  0, C  0 (Ax + C = 0) – straight line parallel to the Oy axis

    B = C = 0, A  0 – the straight line coincides with the Oy axis

    A = C = 0, B  0 – the straight line coincides with the Ox axis

The equation of a straight line can be presented in different forms depending on any given initial conditions.

Equation of a straight line from a point and normal vector.

Definition. In the Cartesian rectangular coordinate system, a vector with components (A, B) is perpendicular to the straight line given by the equation Ax + By + C = 0.

Example. Find the equation of the line passing through the point A(1, 2) perpendicular to the vector (3, -1).

With A = 3 and B = -1, let’s compose the equation of the straight line: 3x – y + C = 0. To find the coefficient C, we substitute the coordinates of the given point A into the resulting expression.

We get: 3 – 2 + C = 0, therefore C = -1.

Total: the required equation: 3x – y – 1 = 0.

Equation of a line passing through two points.

Let two points M 1 (x 1, y 1, z 1) and M 2 (x 2, y 2, z 2) be given in space, then the equation of the line passing through these points is:

If any of the denominators is zero, the corresponding numerator should be set equal to zero.

On the plane, the equation of the straight line written above is simplified:

if x 1  x 2 and x = x 1, if x 1 = x 2.

Fraction
=k is called slope straight.

Example. Find the equation of the line passing through points A(1, 2) and B(3, 4).

Applying the formula written above, we get:

Equation of a straight line using a point and slope.

If the general equation of the straight line Ax + By + C = 0 is reduced to the form:

and designate
, then the resulting equation is called equation of a straight line with slopek.

Equation of a straight line from a point and a direction vector.

By analogy with the point considering the equation of a straight line through a normal vector, you can enter the definition of a straight line through a point and the directing vector of the straight line.

Definition. Every non-zero vector ( 1,  2), the components of which satisfy the condition A 1 + B 2 = 0 is called the directing vector of the line

Ax + Wu + C = 0.

Example. Find the equation of a line with a direction vector (1, -1) and passing through point A(1, 2).

We will look for the equation of the desired line in the form: Ax + By + C = 0. In accordance with the definition, the coefficients must satisfy the conditions:

1A + (-1)B = 0, i.e. A = B.

Then the equation of the straight line has the form: Ax + Ay + C = 0, or x + y + C/A = 0.

at x = 1, y = 2 we get C/A = -3, i.e. required equation:

Equation of a straight line in segments.

If in the general equation of the straight line Ах + Ву + С = 0 С 0, then, dividing by –С, we get:
or

, Where

The geometric meaning of the coefficients is that the coefficient A is the coordinate of the point of intersection of the line with the Ox axis, and b– the coordinate of the point of intersection of the straight line with the Oy axis.

Example. The general equation of the line x – y + 1 = 0 is given. Find the equation of this line in segments.

C = 1,
, a = -1,b = 1.

Normal equation of a line.

If both sides of the equation Ax + By + C = 0 are divided by the number
which is called normalizing factor, then we get

xcos + ysin - p = 0 –

normal equation of a line.

The sign  of the normalizing factor must be chosen so that С< 0.

p is the length of the perpendicular lowered from the origin to the straight line, and  is the angle formed by this perpendicular with the positive direction of the Ox axis.

Example. The general equation of the line 12x – 5y – 65 = 0 is given. It is required to write various types of equations for this line.

equation of this line in segments:

equation of this line with slope: (divide by 5)

normal equation of a line:

;

cos = 12/13; sin = -5/13; p = 5.

Example. It should be noted that not every straight line can be represented by an equation in segments, for example, straight lines parallel to the axes or passing through the origin of coordinates.

The equation of the straight line is:
, a = b = 1; ab/2 = 8; a = 4; -4.

a = -4 is not suitable according to the conditions of the problem.

Total:
or x + y – 4 = 0.

Example. Write an equation for a straight line passing through point A(-2, -3) and the origin.

The equation of the straight line is:
, where x 1 = y 1 = 0; x 2 = -2; y2 = -3.

The angle between straight lines on a plane.

Definition. If two lines are given y = k 1 x + b 1, y = k 2 x + b 2, then the acute angle between these lines will be defined as

.

Two lines are parallel if k 1 = k 2.

Two lines are perpendicular if k 1 = -1/k 2 .

Theorem. Direct lines Ax + Wu + C = 0 and A 1 x + B 1 y + C 1 = 0 are parallel when the coefficients A are proportional 1 = A, B 1 = B. If also C 1 = C, then the lines coincide.

The coordinates of the point of intersection of two lines are found as a solution to the system of equations of these lines.

Equation of a line passing through a given point

perpendicular to this line.

Definition. A straight line passing through the point M 1 (x 1, y 1) and perpendicular to the straight line y = kx + b is represented by the equation:

Distance from a point to a line.

Theorem. If the point M(x) is given 0 , y 0 ), then the distance to the straight line Ах + Ву + С =0 is defined 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 tg =
;

Example. = /4.

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

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

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 the height passes through point C, then its coordinates satisfy this equation:

whence b = 17. Total:

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

Analytical geometry in space.

Equation of a line in space.

Equation of a line in space given a point and direction vector. Let's take an arbitrary line and a vector (m, n, p), parallel to the given line. Vector straight.

On the straight line we take two arbitrary points M 0 (x 0 , y 0 , z 0) and M (x, y, z).

z

M 1

Let us denote the radius vectors of these points as And , it's obvious that - =
.

Because vectors
And are collinear, then the relation is true
= t, where t is some parameter.

In total, we can write: = + t.

Because this equation is satisfied by the coordinates of any point on the line, then the resulting equation is parametric equation of a line.

This vector equation can be represented in coordinate form:

By transforming this system and equating the values ​​of the parameter t, we obtain the canonical equations of a straight line in space:

.

Definition. Direction cosines direct are the direction cosines of the vector , which can be calculated using the formulas:

;

.

From here we get: m: n: p = cos : cos : cos.

The numbers m, n, p are called angle coefficients straight. Because is a non-zero vector, then m, n and p cannot be equal to zero at the same time, but one or two of these numbers can be equal to zero. In this case, in the equation of the line, the corresponding numerators should be set equal to zero.

Equation of a straight line in space passing

through two points.

If on a straight line in space we mark two arbitrary points M 1 (x 1, y 1, z 1) and M 2 (x 2, y 2, z 2), then the coordinates of these points must satisfy the straight line equation obtained above:

.

In addition, for point M 1 we can write:

.

Solving these equations together, we get:

.

This is the equation of a line passing through two points in space.

General equations of a straight line in space.

The equation of a straight line can be considered as the equation of the line of intersection of two planes.

As discussed above, a plane in vector form can be specified by the equation:

+ D = 0, where

- plane normal; - radius is the vector of an arbitrary point on the plane.

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.

Yandex.RTB R-A-339285-1

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 memorize 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

The line passing through the point K(x 0 ; y 0) and parallel to the line y = kx + a is found by the formula:

y - y 0 = k(x - x 0) (1)

Where k is the slope of the line.

Alternative formula:
A line passing through the point M 1 (x 1 ; y 1) and parallel to the line Ax+By+C=0 is represented by the equation

A(x-x 1)+B(y-y 1)=0 . (2)

Write an equation for a line passing through point K( ;) parallel to the straight line y = x+ .
Example No. 1. Write an equation for a straight line passing through the point M 0 (-2,1) and at the same time:
a) parallel to the straight line 2x+3y -7 = 0;
b) perpendicular to the straight line 2x+3y -7 = 0.
Solution . Let's represent the equation with the slope in the form y = kx + a. To do this, move all values ​​except y to the right side: 3y = -2x + 7 . Then divide the right-hand side by a factor of 3. We get: y = -2/3x + 7/3
Let's find the equation NK passing through the point K(-2;1), parallel to the straight line y = -2 / 3 x + 7 / 3
Substituting x 0 = -2, k = -2 / 3, y 0 = 1 we get:
y-1 = -2 / 3 (x-(-2))
or
y = -2 / 3 x - 1 / 3 or 3y + 2x +1 = 0

Example No. 2. Write the equation of a line parallel to the line 2x + 5y = 0 and forming, together with the coordinate axes, a triangle whose area is 5.
Solution . Since the lines are parallel, the equation of the desired line is 2x + 5y + C = 0. The area of ​​a right triangle, where a and b are its legs. Let's find the intersection points of the desired line with the coordinate axes:
;
.
So, A(-C/2,0), B(0,-C/5). Let's substitute it into the formula for area: . We get two solutions: 2x + 5y + 10 = 0 and 2x + 5y – 10 = 0.

Example No. 3. Write an equation for a line passing through the point (-2; 5) and parallel to the line 5x-7y-4=0.
Solution. This straight line can be represented by the equation y = 5 / 7 x – 4 / 7 (here a = 5 / 7). The equation of the desired line is y – 5 = 5 / 7 (x – (-2)), i.e. 7(y-5)=5(x+2) or 5x-7y+45=0 .

Example No. 4. Having solved example 3 (A=5, B=-7) using formula (2), we find 5(x+2)-7(y-5)=0.

Example No. 5. Write an equation for a line passing through the point (-2;5) and parallel to the line 7x+10=0.
Solution. Here A=7, B=0. Formula (2) gives 7(x+2)=0, i.e. x+2=0. Formula (1) is not applicable, since this equation cannot be resolved with respect to y (this straight line is parallel to the ordinate axis).

Equation of a line passing through two points. In the article" " I promised you to look at the second way to solve the presented problems of finding the derivative, given a graph of a function and a tangent to this graph. We will discuss this method in , do not miss! Why in the next one?

The fact is that the formula for the equation of a straight line will be used there. Of course, we could simply show this formula and advise you to learn it. But it’s better to explain where it comes from (how it is derived). It's necessary! If you forget it, you can quickly restore itwill not be difficult. Everything is described in detail below. So, we have two points A on the coordinate plane(x 1;y 1) and B(x 2;y 2), a straight line is drawn through the indicated points:

Here is the direct formula itself:


*That is, when substituting specific coordinates of points, we get an equation of the form y=kx+b.

**If you simply “memorize” this formula, then there is a high probability of getting confused with the indices when X. In addition, indices can be designated in different ways, for example:

That's why it's important to understand the meaning.

Now the derivation of this formula. Everything is very simple!


Triangles ABE and ACF are similar in acute angle (the first sign of similarity of right triangles). It follows from this that the ratios of the corresponding elements are equal, that is:

Now we simply express these segments through the difference in the coordinates of the points:

Of course, there will be no error if you write the relationships of the elements in a different order (the main thing is to maintain consistency):

The result will be the same equation of the line. This is all!

That is, no matter how the points themselves (and their coordinates) are designated, by understanding this formula you will always find the equation of a straight line.

The formula can be derived using the properties of vectors, but the principle of derivation will be the same, since we will be talking about the proportionality of their coordinates. In this case, the same similarity of right triangles works. In my opinion, the conclusion described above is more clear)).

View output using vector coordinates >>>

Let a straight line be constructed on the coordinate plane passing through two given points A(x 1;y 1) and B(x 2;y 2). Let us mark an arbitrary point C on the line with coordinates ( x; y). We also denote two vectors:


It is known that for vectors lying on parallel lines (or on the same line), their corresponding coordinates are proportional, that is:

— we write down the equality of the ratios of the corresponding coordinates:

Let's look at an example:

Find the equation of a straight line passing through two points with coordinates (2;5) and (7:3).

You don’t even have to build the straight line itself. We apply the formula:

It is important that you grasp the correspondence when drawing up the ratio. You can't go wrong if you write:

Answer: y=-2/5x+29/5 go y=-0.4x+5.8

In order to make sure that the resulting equation is found correctly, be sure to check - substitute the coordinates of the data in the condition of the points into it. The equations should be correct.

That's all. I hope the material was useful to you.

Sincerely, Alexander.

P.S: I would be grateful if you tell me about the site on social networks.