The simplest problems with a straight line on a plane. Relative position of lines

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 mutual arrangement 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 along different sides from the straight line, it is enough for the condition to 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 than) 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 one 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 vector 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 resulting from 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.

Lesson from the series “Geometric algorithms”

Hello dear reader!

Let's continue to get acquainted with geometric algorithms. In the last lesson, we found the equation of a straight line using the coordinates of two points. We got an equation of the form:

Today we will write a function that, using the equations of two straight lines, will find the coordinates of their intersection point (if there is one). To check the equality of real numbers, we will use the special function RealEq().

Points on the plane are described by a pair of real numbers. When using a real type, it is better to implement comparison operations using special functions.

The reason is known: on the Real type in the Pascal programming system there is no order relation, so it is better not to use records of the form a = b, where a and b are real numbers.
Today we will introduce the RealEq() function to implement the “=” (strictly equal) operation:

Function RealEq(Const a, b:Real):Boolean; (strictly equal) begin RealEq:=Abs(a-b)<=_Eps End; {RealEq}

Task. The equations of two straight lines are given: and . Find the point of their intersection.

Solution. The obvious solution is to solve the system of line equations: Let's rewrite this system a little differently:
(1)

Let us introduce the following notation: , , . Here D is the determinant of the system, and are the determinants resulting from replacing the column of coefficients for the corresponding unknown with a column of free terms. If , then system (1) is definite, that is, it has a unique solution. This solution can be found using the following formulas: , which are called Cramer formulas. Let me remind you 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.

The code uses the RealEq() function to check equality. Calculations on real numbers are performed with an accuracy of _Eps=1e-7.

Program geom2; Const _Eps: Real=1e-7;(calculation accuracy) var a1,b1,c1,a2,b2,c2,x,y,d,dx,dy:Real; Function RealEq(Const a, b:Real):Boolean; (strictly equal) begin RealEq:=Abs(a-b)<=_Eps End; {RealEq} Function LineToPoint(a1,b1,c1,a2,b2,c2: real; var x,y:real):Boolean; {Определение координат точки пересечения двух линий. Значение функции равно true, если точка пересечения есть, и false, если прямые параллельны. } var d:real; begin d:=a1*b2-b1*a2; if Not(RealEq(d,0)) then begin LineToPoint:=True; dx:=-c1*b2+b1*c2; dy:=-a1*c2+c1*a2; x:=dx/d; y:=dy/d; end else LineToPoint:=False End;{LineToPoint} begin {main} writeln("Введите коэффициенты уравнений: a1,b1,c1,a2,b2,c2 "); readln(a1,b1,c1,a2,b2,c2); if LineToPoint(a1,b1,c1,a2,b2,c2,x,y) then writeln(x:5:1,y:5:1) else writeln("Прямые параллельны."); end.

We have compiled a program with which you can, knowing the equations of lines, find the coordinates of their intersection points.

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 point of intersection 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 a-priory. 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 desired 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 up.

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 exclude 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) .

Perpendicular line

This task is probably one of the most popular and in demand in school textbooks. The tasks based on this topic are varied. This is the definition of the point of intersection of two lines, this is also the definition of the equation of a line passing through a point on the original line at any angle.

We will cover this topic using in our calculations the data obtained using

It was there that the transformation of the general equation of a straight line into an equation with an angular coefficient and vice versa was considered, and the determination of the remaining parameters of the straight line according to given conditions.

What do we lack in order to solve the problems to which this page is devoted?

1. Formulas for calculating one of the angles between two intersecting lines.

If we have two lines that are given by the equations:

then one of the angles is calculated like this:

2. Equation of a straight line with a slope passing through a given point

From formula 1, we can see two borderline states

a) when then and therefore these two given lines are parallel (or coincide)

b) when , then , and therefore these lines are perpendicular, that is, intersect at right angles.

What could be the initial data for solving such problems, other than the given straight line?

A point on a straight line and the angle at which the second straight line intersects it

Second equation of the line

What problems can a bot solve?

1. Two lines are given (explicitly or indirectly, for example, by two points). Calculate the point of intersection and the angles at which they intersect.

2. Given one straight line, a point on a straight line and one angle. Determine the equation of a straight line that intersects a given line at a specified angle

Examples

Two lines are given by equations. Find the point of intersection of these lines and the angles at which they intersect

line_p A=11;B=-5;C=6,k=3/7;b=-5

We get the following result

Equation of the first line

y = 2.2 x + (1.2)

Equation of the second line

y = 0.4285714285714 x + (-5)

Angle of intersection of two straight lines (in degrees)

-42.357454705937

Point of intersection of two lines

x = -3.5

y = -6.5


Don't forget that the parameters of two lines are separated by a comma, and the parameters of each line are separated by a semicolon.

A straight line passes through two points (1:-4) and (5:2). Find the equation of the line that passes through the point (-2:-8) and intersects the original line at an angle of 30 degrees.

We know one straight line because we know the two points through which it passes.

It remains to determine the equation of the second line. We know one point, but instead of the second, the angle at which the first line intersects the second is indicated.

It seems that everything is known, but the main thing here is not to make mistakes. We are talking about the angle (30 degrees) not between the x-axis and the line, but between the first and second line.

This is why we post like this. Let's determine the parameters of the first line and find out at what angle it intersects the x-axis.

line xa=1;xb=5;ya=-4;yb=2

General equation Ax+By+C = 0

Coefficient A = -6

Factor B = 4

Factor C = 22

Coefficient a= 3.6666666666667

Coefficient b = -5.5

Coefficient k = 1.5

Angle of inclination to the axis (in degrees) f = 56.309932474019

Coefficient p = 3.0508510792386

Coefficient q = 2.5535900500422

Distance between points=7.211102550928

We see that the first line intersects the axis at an angle 56.309932474019 degrees.

The source data does not say exactly how the second line intersects the first. You can, after all, construct two lines that satisfy the conditions, the first one rotated 30 degrees CLOCKWISE, and the second 30 degrees COUNTERclockwise.

Let's count them

If the second line is rotated 30 degrees COUNTERclockwise, then the second line will have the degree of intersection with the x-axis 30+56.309932474019 = 86 .309932474019 degrees

line_p xa=-2;ya=-8;f=86.309932474019

Parameters of a straight line according to specified parameters

General equation Ax+By+C = 0

Coefficient A = 23.011106998916

Coefficient B = -1.4840558255286

Coefficient C = 34.149767393603

Equation of a straight line in segments x/a+y/b = 1

Coefficient a= -1.4840558255286

Coefficient b = 23.011106998916

Equation of a straight line with angular coefficient y = kx + b

Coefficient k = 15.505553499458

Angle of inclination to the axis (in degrees) f = 86.309932474019

Normal equation of the line x*cos(q)+y*sin(q)-p = 0

Coefficient p = -1.4809790664999

Coefficient q = 3.0771888256405

Distance between points=23.058912962428

Distance from a point to a straight line li =

that is, our second line equation is y= 15.505553499458x+ 23.011106998916