The formula for calculating the distance between two points. The simplest problems of analytic geometry on the plane. Distance from point to point on a plane, formula

Here is a calculator

Distance between two points on a straight line

Consider a coordinate line on which 2 points are marked: A A A and B B B. To find the distance between these points, you need to find the length of the segment A B AB A B. This is done using the following formula:

Distance between two points on a straight line

A B = ∣ a − b ∣ AB=|a-b|A B =∣ a −b ∣,

where a, b a, b a , b- coordinates of these points on the line (coordinate line).

Due to the fact that there is a module in the formula, it does not matter when deciding which coordinate to subtract from which (since the absolute value of this difference is taken).

∣ a − b ∣ = ∣ b − a ∣ |a-b|=|b-a|∣ a −b ∣ =∣b −a ∣

Let's look at an example to better understand the solution of such problems.

Example 1

A point is marked on the coordinate line A A A, whose coordinate is 9 9 9 and dot B B B with coordinate − 1 -1 − 1 . You need to find the distance between these two points.

Solution

Here a = 9 , b = − 1 a=9, b=-1 a =9, b =− 1

We use the formula and substitute the values:

A B = ∣ a − b ∣ = ∣ 9 − (− 1) ∣ = ∣ 10 ∣ = 10 AB=|a-b|=|9-(-1)|=|10|=10A B =∣ a −b ∣ =∣ 9 − (− 1 ) ∣ = ∣ 1 0 ∣ = 1 0

Answer

Distance between two points on a plane

Consider two points given on a plane. From each point marked on the plane, two perpendiculars must be lowered: On the axis O X OX O X and on the axle O Y OY O Y. Then the triangle is considered A B C ABC A B C. Since it is rectangular ( B C BC B C perpendicular A C AC A C), then find the segment A B AB A B, which is also the distance between points, can be done using the Pythagorean theorem. We have:

A B 2 = A C 2 + B C 2 AB^2=AC^2+BC^2A B 2 = A C 2 + B C 2

But since the length A C AC A C is equal to x B − x A x_B-x_A x Bx A, and the length B C BC B C is equal to y B − y A y_B-y_A y By A, this formula can be rewritten as follows:

Distance between two points on a plane

A B = (x B − x A) 2 + (y B − y A) 2 AB=\sqrt((x_B-x_A)^2+(y_B-y_A)^2)A B =(x Bx A) 2 + (y By A) 2 ,

where x A , y A x_A, y_A x A, y A and x B , y B x_B, y_B x B, y B- point coordinates A A A and B B B respectively.

Example 2

Find the distance between points C C C and F F F, if the coordinates of the first (8 ; − 1) (8;-1) (8 ; − 1 ) , and second - (4 ; 2) (4;2) (4 ; 2 ) .

Solution

X C = 8 x_C=8 x C= 8
yC=-1 y_C=-1 y C= − 1
x F=4 x_F=4 x F= 4
yF=2 y_F=2 y F= 2

C F = (x F − x C) 2 + (y F − y C) 2 = (4 − 8) 2 + (2 − (− 1)) 2 = 16 + 9 = 25 = 5 CF=\sqrt(( x_F-x_C)^2+(y_F-y_C)^2)=\sqrt((4-8)^2+(2-(-1))^2)=\sqrt(16+9)=\sqrt( 25)=5C F =(x Fx C) 2 + (y Fy C) 2 = (4 − 8 ) 2 + (2 − (− 1 ) ) 2 = 1 6 + 9 = 2 5 ​ = 5

Answer

Distance between two points in space

Finding the distance between two points in this case is similar to the previous one, except that the coordinates of the point in space are given by three numbers, respectively, the coordinate of the applicate axis must also be added to the formula. The formula will look like this:

Distance between two points in space

A B = (x B − x A) 2 + (y B − y A) 2 + (z B − z A) 2 AB=\sqrt((x_B-x_A)^2+(y_B-y_A)^2+( z_B-z_A)^2)A B =(x Bx A) 2 + (y By A) 2 + (z B zA ) 2

Example 3

Find the length of a segment FK FK

Solution

F = (− 1 ; − 1 ; 8) F=(-1;-1;8)

F K = (x K − x F) 2 + (y K − y F) 2 + (z K − z F) 2 = (− 3 − (− 1)) 2 + (6 − (− 1)) 2 + (0 − 8) 2 = 117 ≈ 10.8 FK=\sqrt((x_K-x_F)^2+(y_K-y_F)^2+(z_K-z_F)^2)=\sqrt((-3-(-1 ))^2+(6-(-1))^2+(0-8)^2)=\sqrt(117)\approx10.8

According to the condition of the problem, we need to round the answer to an integer.

Theorem 1. For any two points and a plane, the distance between them is expressed by the formula:

For example, if given points and, then the distance between them:

2. Area of ​​a triangle.

Theorem 2. For any points

, not lying on one straight line, the area of ​​the triangle is expressed by the formula:

For example, let's find the area of ​​the triangle formed by the points , and.

Comment. If the area of ​​a triangle is zero, this means that the points lie on the same line.

3. Division of a segment in a given ratio.

Let an arbitrary segment be given on the plane and let

- any point of this segment other than the endpoints. The number defined by equality is called attitude, where the point divides the segment.

The problem of dividing a segment in a given ratio is that, according to a given ratio and given coordinates of points

and find the coordinates of the point.

Theorem 3. If a point divides a segment in a relationship

, then the coordinates of this point are determined by the formulas: (1.3), where are the point coordinates and are the point coordinates.

Consequence: If is the midpoint

, where and, then (1.4) (because).

For example. Given points and. Find the coordinates of a point that is twice as close to than to

Solution: The desired point divides the segment

in regards to because , then ,, got

Polar coordinates

The most important after the rectangular coordinate system is the polar coordinate system. It consists of a certain point called pole, and the beam emanating from it - polar axis. In addition, the scale unit for measuring the lengths of segments is set.

Let a polar coordinate system be given and let be an arbitrary point of the plane. Let be the distance from the point

to the point ; - the angle by which the polar axis must be rotated to coincide with the beam.

Point polar coordinates are called numbers. In this case, the number is considered the first coordinate and is called polar radius, the number is the second coordinate and is called polar angle.

Designated . The polar radius can have any non-negative value:. It is usually believed that the polar angle varies within the following limits: However, in some cases it is necessary to determine the angles counted from the polar axis clockwise.

Relationship between the polar coordinates of a point and its rectangular coordinates.

We will assume that the origin of the rectangular coordinate system is at the pole, and the positive semi-axis of the abscissa coincides with the polar axis.

Let be in a rectangular coordinate system and be in a polar coordinate system. Defined - right triangle c. Then (1.5). These formulas express rectangular coordinates in terms of polar coordinates.

On the other hand, according to the Pythagorean theorem and

(1.6) - these formulas express polar coordinates in terms of rectangular ones.

Note that the formula defines two values ​​of the polar angle, since. Of these two values ​​of the angle, choose the one at which equalities are satisfied.

For example, let's find the polar coordinates of the point ..or, since I quarters.

Example 1: Find a point symmetrical to a point

Relative to the bisector of the first coordinate angle.

Solution:

Let's pass through the point BUT direct l 1 perpendicular to the bisector l first coordinate angle. Let . On a straight line l 1 postpone the segment SA 1 , equal to the segment AS. right triangles ASO and BUT 1 SO are equal to each other (on two legs). It follows from this that | OA| = |OA 1 |. triangles ADO and OEA 1 are also equal to each other (along the hypotenuse and the acute angle). We conclude that |AD| = |OE| = 4,|OD| = |EA 1 | = 2, i.e. point has coordinates x = 4, y = -2, those. BUT 1 (4;-2).

Note that the general statement holds: the point A 1 , symmetrical to a point with respect to the bisector of the first and third coordinate angles, has coordinates , i.e. .

Example 2: Find the point at which the line passing through the points and , will cross the axis Oh.

Solution:

Search point coordinates FROM there is ( x; 0). And since the points BUT,AT and FROM lie on the same straight line, then the condition (x 2 -x 1 )(y 3 -y 1 )-(x 3 -x 1 )(y 2 -y 1 ) = 0 (formula (1.2), area of ​​triangle ABC equals zero!), where are the coordinates of the point BUT, – points AT, – points FROM. We get , i.e., , . Hence the point FROM has coordinates ,, i.e..

Example 3: The points , are given in the polar coordinate system. Find: a) distance between points and ; b) area of ​​a triangle OM 1 M 2 (O- pole).

Solution:

a) We use formulas (1.1) and (1.5):

that is, .

b) using the formula for the area of ​​a triangle with sides a and b and the angle between them (), we find the area of ​​the triangle OM 1 M 2 . .

Maths

§2. Point coordinates on the plane

3. Distance between two points.

We now know how to talk about points in the language of numbers. For example, we no longer need to explain: take a point that is three units to the right of the axis and five units below the axis. Suffice it to say simply: take a point.

We have already said that this creates certain advantages. So, we can transmit a drawing made up of dots by telegraph, communicate it to a computer, which does not understand drawings at all, but understands numbers well.

In the previous paragraph, we defined some sets of points on the plane using relations between numbers. Now let's try to consistently translate other geometric concepts and facts into the language of numbers.

We'll start with a simple and common task.

Find the distance between two points on the plane.

Solution:
As always, we assume that the points are given by their coordinates, and then our task is to find a rule by which we can calculate the distance between points, knowing their coordinates. When deriving this rule, of course, it is allowed to resort to the drawing, but the rule itself should not contain any references to the drawing, but should only show what actions and in what order should be performed on the given numbers - the coordinates of the points, in order to get the desired number - the distance between dots.

Perhaps, some of the readers will find this approach to solving the problem strange and far-fetched. What is simpler, they will say, the points are given, even if they are coordinates. Draw these points, take a ruler and measure the distance between them.

This method is sometimes not so bad. However, imagine again that you are dealing with a computer. She does not have a ruler, and she does not draw, but she can count so quickly that this is not a problem for her at all. Note that our task is set up so that the rule for calculating the distance between two points consists of commands that the machine can execute.

It is better to solve the problem at first for the special case when one of the given points lies at the origin. Start with a few numerical examples: find the distance from the origin of the points ; and .

Instruction. Use the Pythagorean theorem.

Now write a general formula for calculating the distance of a point from the origin.

The distance of a point from the origin is determined by the formula:

Obviously, the rule expressed by this formula satisfies the above conditions. In particular, it can be used in computing on machines that can multiply numbers, add them, and take square roots.

Now let's solve the general problem

Given two points on a plane and find the distance between them.

Solution:
Denote by , , , the projections of the points and on the coordinate axes.

The point of intersection of the lines and will be denoted by the letter . From a right triangle, according to the Pythagorean theorem, we get:

But the length of the segment is equal to the length of the segment. Points and , lie on the axis and have coordinates and , respectively. According to the formula obtained in paragraph 3 of paragraph 2, the distance between them is .

Arguing similarly, we get that the length of the segment is equal to . Substituting the found values ​​and into the formula we get.

Solving problems in mathematics for students is often accompanied by many difficulties. To help the student cope with these difficulties, as well as to teach him how to apply his theoretical knowledge in solving specific problems in all sections of the course of the subject "Mathematics" is the main purpose of our site.

Starting to solve problems on the topic, students should be able to build a point on a plane according to its coordinates, as well as find the coordinates of a given point.

The calculation of the distance between two points taken on the plane A (x A; y A) and B (x B; y B) is performed by the formula d \u003d √ ((x A - x B) 2 + (y A - y B) 2), where d is the length of the segment that connects these points on the plane.

If one of the ends of the segment coincides with the origin, and the other has coordinates M (x M; y M), then the formula for calculating d will take the form OM = √ (x M 2 + y M 2).

1. Calculating the distance between two points given the coordinates of these points

Example 1.

Find the length of the segment that connects the points A(2; -5) and B(-4; 3) on the coordinate plane (Fig. 1).

Solution.

The condition of the problem is given: x A = 2; x B \u003d -4; y A = -5 and y B = 3. Find d.

Applying the formula d \u003d √ ((x A - x B) 2 + (y A - y B) 2), we get:

d \u003d AB \u003d √ ((2 - (-4)) 2 + (-5 - 3) 2) \u003d 10.

2. Calculating the coordinates of a point that is equidistant from three given points

Example 2

Find the coordinates of the point O 1, which is equidistant from the three points A(7; -1) and B(-2; 2) and C(-1; -5).

Solution.

From the formulation of the condition of the problem it follows that O 1 A \u003d O 1 B \u003d O 1 C. Let the desired point O 1 have coordinates (a; b). According to the formula d \u003d √ ((x A - x B) 2 + (y A - y B) 2) we find:

O 1 A \u003d √ ((a - 7) 2 + (b + 1) 2);

O 1 V \u003d √ ((a + 2) 2 + (b - 2) 2);

O 1 C \u003d √ ((a + 1) 2 + (b + 5) 2).

We compose a system of two equations:

(√((a - 7) 2 + (b + 1) 2) = √((a + 2) 2 + (b - 2) 2),
(√((a - 7) 2 + (b + 1) 2) = √((a + 1) 2 + (b + 5) 2).

After squaring the left and right sides of the equations, we write:

((a - 7) 2 + (b + 1) 2 \u003d (a + 2) 2 + (b - 2) 2,
((a - 7) 2 + (b + 1) 2 = (a + 1) 2 + (b + 5) 2 .

Simplifying, we write

(-3a + b + 7 = 0,
(-2a - b + 3 = 0.

Having solved the system, we get: a = 2; b = -1.

Point O 1 (2; -1) is equidistant from the three points given in the condition that do not lie on one straight line. This point is the center of a circle passing through three given points. (Fig. 2).

3. Calculation of the abscissa (ordinate) of a point that lies on the abscissa (ordinate) axis and is at a given distance from this point

Example 3

The distance from point B(-5; 6) to point A lying on the x-axis is 10. Find point A.

Solution.

It follows from the formulation of the condition of the problem that the ordinate of point A is zero and AB = 10.

Denoting the abscissa of the point A through a, we write A(a; 0).

AB \u003d √ ((a + 5) 2 + (0 - 6) 2) \u003d √ ((a + 5) 2 + 36).

We get the equation √((a + 5) 2 + 36) = 10. Simplifying it, we have

a 2 + 10a - 39 = 0.

The roots of this equation a 1 = -13; and 2 = 3.

We get two points A 1 (-13; 0) and A 2 (3; 0).

Examination:

A 1 B \u003d √ ((-13 + 5) 2 + (0 - 6) 2) \u003d 10.

A 2 B \u003d √ ((3 + 5) 2 + (0 - 6) 2) \u003d 10.

Both obtained points fit the condition of the problem (Fig. 3).

4. Calculation of the abscissa (ordinate) of a point that lies on the abscissa (ordinate) axis and is at the same distance from two given points

Example 4

Find a point on the Oy axis that is at the same distance from points A (6; 12) and B (-8; 10).

Solution.

Let the coordinates of the point required by the condition of the problem, lying on the Oy axis, be O 1 (0; b) (at the point lying on the Oy axis, the abscissa is equal to zero). It follows from the condition that O 1 A \u003d O 1 V.

According to the formula d \u003d √ ((x A - x B) 2 + (y A - y B) 2) we find:

O 1 A \u003d √ ((0 - 6) 2 + (b - 12) 2) \u003d √ (36 + (b - 12) 2);

O 1 V \u003d √ ((a + 8) 2 + (b - 10) 2) \u003d √ (64 + (b - 10) 2).

We have the equation √(36 + (b - 12) 2) = √(64 + (b - 10) 2) or 36 + (b - 12) 2 = 64 + (b - 10) 2 .

After simplification, we get: b - 4 = 0, b = 4.

Required by the condition of the problem point O 1 (0; 4) (Fig. 4).

5. Calculating the coordinates of a point that is at the same distance from the coordinate axes and some given point

Example 5

Find point M located on the coordinate plane at the same distance from the coordinate axes and from point A (-2; 1).

Solution.

The required point M, like point A (-2; 1), is located in the second coordinate corner, since it is equidistant from points A, P 1 and P 2 (Fig. 5). The distances of the point M from the coordinate axes are the same, therefore, its coordinates will be (-a; a), where a > 0.

It follows from the conditions of the problem that MA = MP 1 = MP 2, MP 1 = a; MP 2 = |-a|,

those. |-a| = a.

According to the formula d \u003d √ ((x A - x B) 2 + (y A - y B) 2) we find:

MA \u003d √ ((-a + 2) 2 + (a - 1) 2).

Let's make an equation:

√ ((-a + 2) 2 + (a - 1) 2) = a.

After squaring and simplifying, we have: a 2 - 6a + 5 = 0. We solve the equation, we find a 1 = 1; and 2 = 5.

We get two points M 1 (-1; 1) and M 2 (-5; 5), satisfying the condition of the problem.

6. Calculation of the coordinates of a point that is at the same specified distance from the abscissa (ordinate) axis and from this point

Example 6

Find a point M such that its distance from the y-axis and from the point A (8; 6) will be equal to 5.

Solution.

It follows from the condition of the problem that MA = 5 and the abscissa of the point M is equal to 5. Let the ordinate of the point M be equal to b, then M(5; b) (Fig. 6).

According to the formula d \u003d √ ((x A - x B) 2 + (y A - y B) 2) we have:

MA \u003d √ ((5 - 8) 2 + (b - 6) 2).

Let's make an equation:

√((5 - 8) 2 + (b - 6) 2) = 5. Simplifying it, we get: b 2 - 12b + 20 = 0. The roots of this equation are b 1 = 2; b 2 \u003d 10. Therefore, there are two points that satisfy the condition of the problem: M 1 (5; 2) and M 2 (5; 10).

It is known that many students, when solving problems on their own, need constant consultations on techniques and methods for solving them. Often, a student cannot find a way to solve a problem without the help of a teacher. The student can get the necessary advice on solving problems on our website.

Do you have any questions? Not sure how to find the distance between two points on a plane?
To get the help of a tutor - register.
The first lesson is free!

site, with full or partial copying of the material, a link to the source is required.

The calculation of distances between points according to their coordinates on a plane is elementary, on the Earth's surface it is a little more complicated: we will consider measuring the distance and initial azimuth between points without projection transformations. First, let's understand the terminology.

Introduction

Great circle arc length- the shortest distance between any two points located on the surface of the sphere, measured along the line connecting these two points (such a line is called the orthodrome) and passing along the surface of the sphere or other surface of revolution. Spherical geometry is different from the usual Euclidean and the distance equations also take a different form. In Euclidean geometry, the shortest distance between two points is a straight line. On a sphere, there are no straight lines. These lines on the sphere are part of great circles - circles whose centers coincide with the center of the sphere. Initial azimuth- azimuth, which, when starting from point A, following the great circle for the shortest distance to point B, the end point will be point B. When moving from point A to point B along the great circle line, the azimuth from the current position to the end point B is constant is changing. The initial azimuth is different from a constant one, following which the azimuth from the current point to the final one does not change, but the route is not the shortest distance between two points.

Through any two points on the surface of the sphere, if they are not directly opposite to each other (that is, they are not antipodes), a unique great circle can be drawn. Two points divide the great circle into two arcs. The length of a short arc is the shortest distance between two points. An infinite number of great circles can be drawn between two antipodal points, but the distance between them will be the same on any circle and equal to half the circumference of the circle, or π*R, where R is the radius of the sphere.

On a plane (in a rectangular coordinate system), great circles and their fragments, as mentioned above, are arcs in all projections, except for the gnomonic one, where great circles are straight lines. In practice, this means that airplanes and other air transport always use the route of the minimum distance between points to save fuel, that is, the flight is carried out along the distance of a great circle, on the plane it looks like an arc.

The shape of the Earth can be described as a sphere, so the great circle distance equations are important for calculating the shortest distance between points on the Earth's surface and are often used in navigation. Calculating the distance by this method is more efficient and in many cases more accurate than calculating it for projected coordinates (in rectangular coordinate systems), because, firstly, for this it is not necessary to translate geographical coordinates into a rectangular coordinate system (perform projection transformations) and, secondly, many projections, if incorrectly chosen, can lead to significant length distortions due to the nature of projection distortions. It is known that not a sphere, but an ellipsoid describes the shape of the Earth more accurately, however, this article discusses the calculation of distances on a sphere, for calculations a sphere with a radius of 6372795 meters is used, which can lead to an error in calculating distances of the order of 0.5%.

Formulas

There are three ways to calculate the spherical distance of a great circle. 1. Spherical cosine theorem In the case of small distances and small calculation bit depth (number of decimal places), the use of the formula can lead to significant rounding errors. φ1, λ1; φ2, λ2 - latitude and longitude of two points in radians Δλ - coordinate difference in longitude Δδ - angular difference Δδ = arccos (sin φ1 sin φ2 + cos φ1 cos φ2 cos Δλ) To convert the angular distance to metric, you need to multiply the angular difference by the radius Earth (6372795 meters), the units of the final distance will be equal to the units in which the radius is expressed (in this case, meters). 2. Haversine Formula Used to avoid problems with short distances. 3. Modification for antipodes The previous formula is also subject to the problem of antipodes, in order to solve it, the following modification is used.

My implementation in PHP

// Earth radius define("EARTH_RADIUS", 6372795); /* * Distance between two points * $φA, $λA - latitude, longitude of the 1st point, * $φB, $λB - latitude, longitude of the 2nd point * Based on http://gis-lab.info/ qa/great-circles.html * Mikhail Kobzarev< >* */ function calculateTheDistance ($φA, $λA, $φB, $λB) ( // convert coordinates to radians $lat1 = $φA * M_PI / 180; $lat2 = $φB * M_PI / 180; $long1 = $λA * M_PI / 180; $long2 = $λB * M_PI / 180; // cosines and sines of latitudes and longitude differences $cl1 = cos($lat1); $cl2 = cos($lat2); $sl1 = sin($lat1) ; $sl2 = sin($lat2); $delta = $long2 - $long1; $cdelta = cos($delta); $sdelta = sin($delta); // calculating the great circle length $y = sqrt(pow( $cl2 * $sdelta, 2) + pow($cl1 * $sl2 - $sl1 * $cl2 * $cdelta, 2)); $x = $sl1 * $sl2 + $cl1 * $cl2 * $cdelta; // $ad = atan2($y, $x); $dist = $ad * EARTH_RADIUS; return $dist; ) Function call example: $lat1 = 77.1539; $long1 = -139.398; $lat2 = -77.1804; $long2 = -139.55; echo calculateTheDistance($lat1, $long1, $lat2, $long2) . "meters"; // Returns "17166029 meters"

Article taken from the site