- To find the coordinates of the intersection point of the graphs of functions, you need to equate both functions to each other, move all terms containing $ x $ to the left side, and the rest to the right side, and find the roots of the resulting equation.
- The second method is to create a system of equations and solve it by substituting one function into another
- The third method involves graphically constructing functions and visually determining the intersection point.
The case of two linear functions
Consider two linear functions $ f(x) = k_1 x+m_1 $ and $ g(x) = k_2 x + m_2 $. These functions are called direct. It is quite easy to construct them; you need to take any two values $ x_1 $ and $ x_2 $ and find $ f(x_1) $ and $ (x_2) $. Then repeat the same with the function $ g(x) $. Next, visually find the coordinate of the intersection point of the function graphs.
You should know that linear functions have only one intersection point and only when $ k_1 \neq k_2 $. Otherwise, in the case of $ k_1=k_2 $ the functions are parallel to each other, since $ k $ is the slope coefficient. If $ k_1 \neq k_2 $, but $ m_1=m_2 $, then the intersection point will be $ M(0;m) $. It is advisable to remember this rule to quickly solve problems.
Example 1 |
Let $ f(x) = 2x-5 $ and $ g(x)=x+3 $ be given. Find the coordinates of the intersection point of the function graphs. |
Solution |
How to do this? Since two linear functions are presented, the first thing we look at is the slope coefficient of both functions $ k_1 = 2 $ and $ k_2 = 1 $. We note that $ k_1 \neq k_2 $, so there is one intersection point. Let's find it using the equation $ f(x)=g(x) $: $$ 2x-5 = x+3 $$ We move the terms with $ x $ to the left side, and the rest to the right: $$ 2x - x = 3+5 $$ We have obtained $ x=8 $ the abscissa of the intersection point of the graphs, and now let’s find the ordinate. To do this, let’s substitute $ x = 8 $ into any of the equations, either in $ f(x) $ or in $ g(x) $: $$ f(8) = 2\cdot 8 - 5 = 16 - 5 = 11 $$ So, $ M (8;11) $ is the point of intersection of the graphs of two linear functions. If you cannot solve your problem, then send it to us. We will provide detailed solution. You will be able to view the progress of the calculation and gain information. This will help you get your grade from your teacher in a timely manner! |
Answer |
$$ M (8;11) $$ |
The case of two nonlinear functions
Example 3 |
Find the coordinates of the intersection point of the function graphs: $ f(x)=x^2-2x+1 $ and $ g(x)=x^2+1 $ |
Solution |
What about two nonlinear functions? The algorithm is simple: we equate the equations to each other and find the roots: $$ x^2-2x+1=x^2+1 $$ We distribute terms with and without $ x $ on different sides of the equation: $$ x^2-2x-x^2=1-1 $$ The abscissa of the desired point has been found, but it is not enough. The ordinate $y$ is still missing. We substitute $ x = 0 $ into any of the two equations of the problem condition. For example: $$ f(0)=0^2-2\cdot 0 + 1 = 1 $$ $ M (0;1) $ - intersection point of function graphs |
Answer |
$$ M (0;1) $$ |
When solving some geometric problems using the coordinate method, you have to find the coordinates of the point of intersection of lines. Most often you have to look for the coordinates of the point of intersection of two lines on a plane, but sometimes there is a need to determine the coordinates of the point of intersection of two lines in space. In this article we will deal with finding the coordinates of the point at which two lines intersect.
Page navigation.
The point of intersection of two lines is a definition.
Let's first define the point of intersection of two lines.
In the section on the relative position of lines on a plane, it is shown that two lines on a plane can either coincide (and they have infinitely many common points), or be parallel (and two lines have no common points), or intersect, having one common point. There are more options for the relative position of two lines in space - they can coincide (have infinitely many common points), they can be parallel (that is, lie in the same plane and do not intersect), they can be intersecting (not lie in the same plane), and they can also have one common point, that is, intersect. So, two lines both on the plane and in space are called intersecting if they have one common point.
From the definition of intersecting lines it follows determining the point of intersection of lines: The point at which two lines intersect is called the point of intersection of these lines. In other words, the only common point of two intersecting lines is the point of intersection of these lines.
For clarity, we present a graphical illustration of the point of intersection of two straight lines on a plane and in space.
Top of page
Finding the coordinates of the intersection point of two lines on a plane.
Before finding the coordinates of the intersection point of two straight lines on a plane using their known equations, consider an auxiliary problem.
Oxy a And b. We will assume that straight a corresponds to a general equation of the straight line of the form , and the straight line b– type . Let be some point on the plane, and we need to find out whether the point is M 0 the point of intersection of given lines.
Let's solve the problem.
If M0 a And b, then by definition it also belongs to the line a and straight b, that is, its coordinates must satisfy both the equation and the equation. Therefore, we need to substitute the coordinates of the point M 0 into the equations of given lines and see if this results in two correct equalities. If the coordinates of the point M 0 satisfy both equations and , then is the point of intersection of the lines a And b, otherwise M 0 .
Is the point M 0 with coordinates (2, -3) point of intersection of lines 5x-2y-16=0 And 2x-5y-19=0?
If M 0 is indeed the point of intersection of given lines, then its coordinates satisfy the equations of lines. Let's check this by substituting the coordinates of the point M 0 into the given equations:
We got two true equalities, therefore, M 0 (2, -3)- point of intersection of lines 5x-2y-16=0 And 2x-5y-19=0.
For clarity, we present a drawing that shows straight lines and the coordinates of their intersection points are visible.
yes, period M 0 (2, -3) is the point of intersection of the lines 5x-2y-16=0 And 2x-5y-19=0.
Do the lines intersect? 5x+3y-1=0 And 7x-2y+11=0 at the point M 0 (2, -3)?
Let's substitute the coordinates of the point M 0 into the equations of straight lines, this action will check whether the point belongs to M 0 both straight lines at the same time:
Since the second equation, when substituting the coordinates of the point into it M 0 did not turn into a true equality, then point M 0 does not belong to the line 7x-2y+11=0. From this fact we can conclude that the point M 0 is not the point of intersection of the given lines.
The drawing also clearly shows that the point M 0 is not the point of intersection of lines 5x+3y-1=0 And 7x-2y+11=0. Obviously, the given lines intersect at a point with coordinates (-1, 2) .
M 0 (2, -3) is not the point of intersection of lines 5x+3y-1=0 And 7x-2y+11=0.
Now we can move on to the task of finding the coordinates of the point of intersection of two lines using the given equations of lines on a plane.
Let a rectangular Cartesian coordinate system be fixed on the plane Oxy and given two intersecting lines a And b equations and respectively. Let us denote the point of intersection of the given lines as M 0 and solve the following problem: find the coordinates of the point of intersection of two lines a And b according to the known equations of these lines and .
Dot M0 belongs to each of the intersecting lines a And b by definition. Then the coordinates of the point of intersection of the lines a And b satisfy both the equation and the equation . Therefore, the coordinates of the point of intersection of two lines a And b are the solution to a system of equations (see the article solving systems of linear algebraic equations).
Thus, in order to find the coordinates of the point of intersection of two straight lines defined on a plane by general equations, you need to solve a system composed of equations of given straight lines.
Let's look at the example solution.
Find the intersection point of two lines defined in a rectangular coordinate system on a plane by the equations x-9y+14=0 And 5x-2y-16=0.
We are given two general equations of lines, let's make a system out of them: . Solutions to the resulting system of equations are easily found by solving its first equation with respect to the variable x and substitute this expression into the second equation:
The found solution to the system of equations gives us the desired coordinates of the point of intersection of two lines.
M 0 (4, 2)– point of intersection of lines x-9y+14=0 And 5x-2y-16=0.
So, finding the coordinates of the point of intersection of two straight lines, defined by general equations on a plane, comes down to solving a system of two linear equations with two unknown variables. But what if lines on a plane are given not by general equations, but by equations of a different type (see types of equations of a line on a plane)? In these cases, you can first reduce the equations of lines to a general form, and only after that find the coordinates of the intersection point.
Before finding the coordinates of the intersection point of the given lines, we reduce their equations to a general form. The transition from the parametric equations of a line to the general equation of this line looks like this:
Now let's carry out the necessary actions with the canonical equation of the straight line:
Thus, the desired coordinates of the point of intersection of the lines are a solution to a system of equations of the form . We use Cramer's method to solve it:
M 0 (-5, 1)
There is another way to find the coordinates of the point of intersection of two lines on a plane. It is convenient to use when one of the lines is given by parametric equations of the form , and the other by a line equation of a different type. In this case, in another equation instead of variables x And y you can substitute the expressions and , from where you can get the value that corresponds to the intersection point of the given lines. In this case, the point of intersection of the lines has coordinates.
Let's find the coordinates of the point of intersection of the lines from the previous example using this method.
Determine the coordinates of the point of intersection of the lines and .
Let's substitute the straight line expression into the equation:
Having solved the resulting equation, we get . This value corresponds to the common point of the lines and . We calculate the coordinates of the intersection point by substituting a straight line into the parametric equations:
.
M 0 (-5, 1).
To complete the picture, one more point should be discussed.
Before finding the coordinates of the point of intersection of two lines on a plane, it is useful to make sure that the given lines actually intersect. If it turns out that the original lines coincide or are parallel, then there can be no question of finding the coordinates of the point of intersection of such lines.
You can, of course, do without such a check, but immediately create a system of equations of the form and solve it. If a system of equations has a unique solution, then it gives the coordinates of the point at which the original lines intersect. If the system of equations does not have solutions, then we can conclude that the original lines are parallel (since there is no such pair of real numbers x And y, which would simultaneously satisfy both equations of the given lines). From the presence of an infinite number of solutions to a system of equations, it follows that the original straight lines have infinitely many common points, that is, they coincide.
Let's look at examples that fit these situations.
Find out whether the lines and intersect, and if they intersect, then find the coordinates of the intersection point.
The given equations of lines correspond to the equations and . Let's solve the system made up of these equations.
It is obvious that the equations of the system are linearly expressed through each other (the second equation of the system is obtained from the first by multiplying both its parts by 4 ), therefore, the system of equations has an infinite number of solutions. Thus, the equations define the same line, and we cannot talk about finding the coordinates of the point of intersection of these lines.
equations and are defined in a rectangular coordinate system Oxy the same straight line, so we cannot talk about finding the coordinates of the intersection point.
Find the coordinates of the point of intersection of the lines and , if possible.
The condition of the problem allows that the lines may not intersect. Let's create a system from these equations. Let us apply the Gauss method to solve it, since it allows us to establish the compatibility or incompatibility of a system of equations, and if it is compatible, find a solution:
The last equation of the system after the direct passage of the Gauss method turned into an incorrect equality, therefore, the system of equations has no solutions. From this we can conclude that the original lines are parallel, and we cannot talk about finding the coordinates of the point of intersection of these lines.
Second solution.
Let's find out whether the given lines intersect.
A normal vector is a line, and a vector is a normal vector of a line. Let us check that the condition for collinearity of vectors and : the equality is true, since , therefore, the normal vectors of the given straight lines are collinear. Then these lines are parallel or coincident. Thus, we cannot find the coordinates of the intersection point of the original lines.
it is impossible to find the coordinates of the intersection point of the given lines, since these lines are parallel.
Find the coordinates of the point of intersection of the lines 2x-1=0 and , if they intersect.
Let's compose a system of equations that are general equations of given lines: . The determinant of the main matrix of this system of equations is nonzero, therefore the system of equations has a unique solution, which indicates the intersection of the given lines.
To find the coordinates of the point of intersection of the lines, we need to solve the system:
The resulting solution gives us the coordinates of the point of intersection of the lines, that is, the point of intersection of the lines 2x-1=0 And .
Top of page
Finding the coordinates of the point of intersection of two lines in space.
The coordinates of the point of intersection of two lines in three-dimensional space are found similarly.
Let the intersecting lines a And b specified in a rectangular coordinate system Oxyz equations of two intersecting planes, that is, a straight line a is determined by a system of the form , and the straight line b- . Let M 0– point of intersection of lines a And b. Then point M 0 by definition also belongs to the line a and straight b, therefore, its coordinates satisfy the equations of both lines. Thus, the coordinates of the point of intersection of the lines a And b represent a solution to a system of linear equations of the form . Here we will need information from the section on solving systems of linear equations in which the number of equations does not coincide with the number of unknown variables.
Let's look at the solutions to the examples.
Find the coordinates of the point of intersection of two lines defined in space by the equations and .
Let's compose a system of equations from the equations of the given lines: . The solution of this system will give us the required coordinates of the point of intersection of lines in space. Let's find the solution to the written system of equations.
The main matrix of the system has the form , and the extended one - .
Let's determine the rank of the matrix A and matrix rank T. We use the method of bordering minors, but we will not describe in detail the calculation of determinants (if necessary, refer to the article Calculation of the determinant of a matrix):
Thus, the rank of the main matrix is equal to the rank of the extended matrix and is equal to three.
Consequently, the system of equations has a unique solution.
We will take the determinant as the basis minor, therefore the last equation should be excluded from the system of equations, since it does not participate in the formation of the basis minor. So,
The solution to the resulting system is easy to find:
Thus, the point of intersection of the lines has coordinates (1, -3, 0) .
(1, -3, 0) .
It should be noted that the system of equations has a unique solution if and only if the straight lines a And b intersect. If straight A And b parallel or crossing, then the last system of equations has no solutions, since in this case the lines do not have common points. If straight a And b coincide, then they have an infinite number of common points, therefore, the indicated system of equations has an infinite number of solutions. However, in these cases we cannot talk about finding the coordinates of the point of intersection of the lines, since the lines are not intersecting.
Thus, if we do not know in advance whether the given lines intersect a And b or not, then it is reasonable to create a system of equations of the form and solve it by the Gauss method. If we get a unique solution, then it will correspond to the coordinates of the point of intersection of the lines a And b. If the system turns out to be inconsistent, then the direct a And b do not intersect. If the system has an infinite number of solutions, then the straight lines a And b match.
You can do without using the Gaussian method. Alternatively, you can calculate the ranks of the main and extended matrices of this system, and based on the data obtained and the Kronecker-Capelli theorem, conclude either the existence of a single solution, or the existence of many solutions, or the absence of solutions. It's a matter of taste.
If the lines intersect, then determine the coordinates of the intersection point.
Let's create a system from the given equations: . Let's solve it using the Gaussian method in matrix form:
It became clear that the system of equations has no solutions, therefore, the given lines do not intersect, and there can be no question of finding the coordinates of the point of intersection of these lines.
we cannot find the coordinates of the intersection point of the given lines, since these lines do not intersect.
When intersecting lines are given by canonical equations of a line in space or parametric equations of a line in space, then one should first obtain their equations in the form of two intersecting planes, and only after that find the coordinates of the intersection point.
Two intersecting lines are defined in a rectangular coordinate system Oxyz equations and . Find the coordinates of the point of intersection of these lines.
Let us define the initial straight lines by the equations of two intersecting planes:
To find the coordinates of the point of intersection of the lines, it remains to solve the system of equations. The rank of the main matrix of this system is equal to the rank of the extended matrix and is equal to three (we recommend checking this fact). Let us take as the basis minor; therefore, we can eliminate the last equation from the system. Having solved the resulting system using any method (for example, Cramer’s method), we obtain the solution. Thus, the point of intersection of the lines has coordinates (-2, 3, -5) .
Intersection point
Let us be given two straight lines, defined by their coefficients and . You need to find their point of intersection, or find out that the lines are parallel.
Solution
If two lines are not parallel, then they intersect. To find the intersection point, it is enough to create a system of two straight line equations and solve it:
Using Cramer’s formula, we immediately find a solution to the system, which will be the desired one intersection point:
If the denominator is zero, i.e.
then the system has no solutions (direct parallel and do not coincide) or has infinitely many (direct match). If it is necessary to distinguish between these two cases, it is necessary to check that the coefficients of the lines are proportional with the same coefficient of proportionality as the coefficients and , for which it is enough to calculate the two determinants; if they are both equal to zero, then the lines coincide:
Implementation
struct pt(double x, y;); struct line(double a, b, c;); constdouble EPS =1e-9; double det (double a, double b, double c, double d)(return a * d - b * c;) bool intersect (line m, line n, pt & res)(double zn = det (m.a, m.b, n.a , n.b);if(abs(zn)< EPS)returnfalse; res.x=- det (m.c, m.b, n.c, n.b)/ zn; res.y=- det (m.a, m.c, n.a, n.c)/ zn;returntrue;} bool parallel (line m, line n){returnabs(det (m.a, m.b, n.a, n.b))< EPS;} bool equivalent (line m, line n){returnabs(det (m.a, m.b, n.a, n.b))< EPS &&abs(det (m.a, m.c, n.a, n.c))< EPS &&abs(det (m.b, m.c, n.b, n.c))< EPS;}
Lesson from the series “ Geometric algorithms»
Hello dear reader.
Tip 1: How to find the coordinates of the point of intersection of two lines
Let's write three more new functions.
The LinesCross() function will determine whether intersect whether two segment. In it, the relative position of the segments is determined using vector products. To calculate vector products, we will write a function – VektorMulti().
The RealLess() function will be used to implement the comparison operation “<” (строго меньше) для вещественных чисел.
Task 1. Two segments are given by their coordinates. Write a program that determines do these segments intersect? without finding the intersection point.
Solution
. The second is given by dots.
Consider the segment and points and .
The point lies to the left of the line, for it the vector product
> 0, since the vectors are positively oriented.
The point is located to the right of the line, for which the vector product is < 0, так как векторы отрицательно ориентированы.
In order for the points and to lie on opposite sides of the straight line, it is sufficient that the condition be satisfied< 0 (векторные произведения имели противоположные знаки).
Similar reasoning can be carried out for the segment and points and .
So if , then the segments intersect.
To check this condition, the LinesCross() function is used, and the VektorMulti() function is used to calculate vector products.
ax, ay – coordinates of the first vector,
bx, by – coordinates of the second vector.
Program geometr4; (Do 2 segments intersect?) Const _Eps: Real=1e-4; (calculation accuracy) var x1,y1,x2,y2,x3,y3,x4,y4: real; var v1,v2,v3,v4: real;function RealLess(Const a, b: Real): Boolean; (Strictly less) begin RealLess:= b-a> _Eps end; (RealLess)function VektorMulti(ax,ay,bx,by:real): real; (ax,ay - a coordinates bx,by - b coordinates) begin vektormulti:= ax*by-bx*ay; end;Function LinesCross(x1,y1,x2,y2,x3,y3,x4,y4:real): boolean; (Do the segments intersect?) begin v1:=vektormulti(x4-x3,y4-y3,x1-x3,y1-y3); v2:=vektormulti(x4-x3,y4-y3,x2-x3,y2-y3); v3:=vektormulti(x2-x1,y2-y1,x3-x1,y3-y1); v4:=vektormulti(x2-x1,y2-y1,x4-x1,y4-y1); if RealLess(v1*v2,0) and RealLess(v3*v4,0) (v1v2<0 и v3v4<0, отрезки пересекаются} then LinesCross:= true else LinesCross:= false end; {LinesCross}begin {main} writeln(‘Введите координаты отрезков: x1,y1,x2,y2,x3,y3,x4,y4’); readln(x1,y1,x2,y2,x3,y3,x4,y4); if LinesCross(x1,y1,x2,y2,x3,y3,x4,y4) then writeln (‘Да’) else writeln (‘Нет’) end.
Program execution results:
Enter the coordinates of the segments: -1 1 2 2.52 2 1 -1 3
Yes.
We wrote a program that determines whether segments specified by their coordinates intersect.
In the next lesson we will create an algorithm that can be used to determine whether a point lies inside a triangle.
Dear reader.
You have already become acquainted with several lessons from the Geometric Algorithms series. Is everything written in an accessible way? I will be very grateful if you leave feedback about these lessons. Perhaps something still needs to be improved.
Sincerely, Vera Gospodarets.
Let two segments be given. The first one is given by dots P 1 (x 1 ;y 1) And P 2 (x 2 ;y 2). The second is given by points P 3 (x 3 ;y 3) And P 4 (x 4 ;y 4).
The relative position of the segments can be checked using vector products:
Consider the segment P 3 P 4 and dots P 1 And P2.
Dot P 1 lies to the left of the line P 3 P 4, for her the vector product v 1 > 0, since the vectors are positively oriented.
Dot P2 located to the right of the line, for it the vector product v 2< 0
, since the vectors are negatively oriented.
To make the point P 1 And P2 lay on opposite sides of a straight line P 3 P 4, it is sufficient for the condition to be satisfied v 1 v 2< 0 (the vector products had opposite signs).
Similar reasoning can be carried out for the segment P 1 P 2 and points P 3 And P 4.
So if v 1 v 2< 0 And v 3 v 4< 0 , then the segments intersect.
The cross product of two vectors is calculated using the formula:
Where:
ax, ay— coordinates of the first vector,
bx, by— coordinates of the second vector.
Equation of a line passing through two different points specified by their coordinates.
Let two non-coinciding points be given on a straight line: P 1 with coordinates ( x 1 ;y 1) And P2 with coordinates (x 2 ; y 2).
Intersection of lines
Accordingly, a vector with origin at the point P 1 and end at a point P2 has coordinates (x 2 -x 1 , y 2 -y 1). If P(x, y) is an arbitrary point on a line, then the coordinates of the vector P 1 P equal (x - x 1, y - y 1).
Using the vector product, the condition for collinearity of vectors P 1 P And P 1 P 2 can be written like this:
|P 1 P,P 1 P 2 |=0, i.e. (x-x 1)(y 2 -y 1)-(y-y 1)(x 2 -x 1)=0
or
(y 2 -y 1)x + (x 1 -x 2)y + x 1 (y 1 -y 2) + y 1 (x 2 -x 1) = 0
The last equation is rewritten as follows:
ax + by + c = 0, (1)
Where
a = (y 2 -y 1),
b = (x 1 -x 2),
c = x 1 (y 1 -y 2) + y 1 (x 2 -x 1)
So, the straight line can be specified by an equation of the form (1).
How to find the point of intersection of lines?
The obvious solution is to solve the system of line equations:
ax 1 +by 1 =-c 1
ax 2 +by 2 =-c 2 (2)
Enter symbols:
Here D is the determinant of the system, and Dx,Dy— determinants obtained by replacing the column of coefficients with the corresponding unknown with a column of free terms. If D ≠ 0, then system (2) is definite, that is, it has a unique solution. This solution can be found using the following formulas: x 1 =D x /D, y 1 =D y /D, which are called Cramer's formulas. A quick reminder of how the second-order determinant is calculated. The determinant distinguishes two diagonals: the main and the secondary. The main diagonal consists of elements taken in the direction from the upper left corner of the determinant to the lower right corner. Side diagonal - from the upper right to the lower left. The second-order determinant is equal to the product of the elements of the main diagonal minus the product of the elements of the secondary diagonal.