The intersection of lines.
In Euclidean geometry, the intersection of a line and a line can be the empty set, a point, or a line. Distinguishing these cases and finding the intersection signal have apply, for example, in computer graphics, move planning, and collision detection.
In three-dimensional Euclidean geometry, if two lines are not in the same plane they are chosen skew lines and have no point of intersection. If they are in the same plane there are three possibilities: if they coincide (are not distinct lines) they accept an infinitude of points in mutual (namely all of the points on either of them); if they are distinct merely have the same slope they are said to be parallel and have no points in common; otherwise they take a unmarried point of intersection.
The distinguishing features of non-Euclidean geometry are the number and locations of possible intersections betwixt two lines and the number of possible lines with no intersections (parallel lines) with a given line.
Formulas [edit]
A necessary condition for two lines to intersect is that they are in the same aeroplane—that is, are non skew lines. Satisfaction of this status is equivalent to the tetrahedron with vertices at two of the points on one line and two of the points on the other line being degenerate in the sense of having zero volume. For the algebraic form of this condition, meet Skew lines § Testing for skewness.
Given two points on each line [edit]
Offset we consider the intersection of two lines and in ii-dimensional space, with line being defined by two distinct points and , and line beingness defined by two singled-out points and .[ane]
The intersection of line and tin be defined using determinants.
-
The determinants can be written out as:
-
where the denominator is:
-
When the 2 lines are parallel or coincident, the denominator is nothing. If the lines are almost parallel, then a computer solution might encounter numeric problems implementing the solution described in a higher place: the recognition of this condition might require an approximate examination in a applied awarding. An alternate approach might be to rotate the line segments so that one of them is horizontal, whence the solution of the rotated parametric form of the second line is hands obtained. Careful discussion of the special cases is required (parallel lines/coincident lines, overlapping/non-overlapping intervals).
Given two points on each line segment [edit]
Notation that the intersection bespeak to a higher place is for the infinitely long lines defined by the points, rather than the line segments between the points, and can produce an intersection point not contained in either of the ii line segments. In club to find the position of the intersection in respect to the line segments, we tin define lines and in terms of first degree Bézier parameters:
-
(where t and u are existent numbers). The intersection signal of the lines is found with one of the following values of t or u, where
-
and
-
with:
-
In that location will be an intersection if 0.0 ≤t ≤ ane.0 and 0.0 ≤u ≤ one.0. The intersection point falls within the first line segment if 0.0 ≤t ≤ one.0, and information technology falls within the second line segment if 0.0 ≤u ≤ 1.0. These inequalities tin can be tested without the need for division, allowing rapid determination of the existence of any line segment intersection before computing its verbal betoken.[two]
Given two line equations [edit]
The and coordinates of the bespeak of intersection of two non-vertical lines tin easily be found using the post-obit substitutions and rearrangements.
Suppose that 2 lines accept the equations and where and are the slopes (gradients) of the lines and where and are the y-intercepts of the lines. At the betoken where the two lines intersect (if they do), both coordinates will be the same, hence the post-obit equality:
-
We can rearrange this expression in lodge to excerpt the value of ,
-
and and so,
-
To find the y coordinate, all we demand to do is substitute the value of x into either one of the two line equations, for case, into the showtime:
-
Hence, the point of intersection is
-
Note if a = b then the two lines are parallel. If c ≠ d every bit well, the lines are different and there is no intersection, otherwise the 2 lines are identical.
Using homogeneous coordinates [edit]
Past using homogeneous coordinates, the intersection bespeak of two implicitly defined lines can be adamant quite hands. In 2d, every point can be divers as a projection of a 3D point, given as the ordered triple . The mapping from 3D to 2D coordinates is . We can convert 2D points to homogeneous coordinates by defining them equally .
Presume that we want to find intersection of two infinite lines in 2-dimensional space, defined every bit and . We can represent these two lines in line coordinates every bit and ,
The intersection of two lines is then simply given by,[3]
-
If the lines do not intersect.
More two lines [edit]
The intersection of ii lines can exist generalized to involve additional lines. Existence of and expression for the n-line intersection trouble are as follows.
In two dimensions [edit]
In ii dimensions, more than two lines almost certainly do not intersect at a unmarried indicate. To make up one's mind if they do and, if and so, to find the intersection point, write the i-th equation (i = 1, …,n) as and stack these equations into matrix class as
-
where the i-th row of the northward × 2 matrix A is , west is the 2 × 1 vector (x, y)T, and the i-th element of the column vector b is b i . If A has independent columns, its rank is 2. Then if and only if the rank of the augmented matrix [A | b] is also 2, there exists a solution of the matrix equation and thus an intersection point of the n lines. The intersection betoken, if it exists, is given by
-
where is the Moore-Penrose generalized inverse of (which has the class shown because A has full cavalcade rank). Alternatively, the solution can be plant past jointly solving whatsoever two independent equations. But if the rank of A is only 1, and then if the rank of the augmented matrix is ii there is no solution but if its rank is 1 then all of the lines coincide with each other.
In 3 dimensions [edit]
The above approach can be readily extended to three dimensions. In 3 or more dimensions, even two lines almost certainly do not intersect; pairs of not-parallel lines that do not intersect are called skew lines. But if an intersection does exist it tin be found, every bit follows.
In iii dimensions a line is represented by the intersection of two planes, each of which has an equation of the form Thus a set of northward lines can be represented past 2north equations in the 3-dimensional coordinate vector w = (x, y, z)T:
-
where now A is 2due north × 3 and b is iin × 1. As before at that place is a unique intersection point if and only if A has full column rank and the augmented matrix [A | b] does not, and the unique intersection if it exists is given past
-
Nearest points to skew lines [edit]
In two or more dimensions, we can usually find a point that is mutually closest to two or more lines in a least-squares sense.
In 2 dimensions [edit]
In the two-dimensional case, kickoff, represent line i as a point, , on the line and a unit of measurement normal vector, , perpendicular to that line. That is, if and are points on line 1, and then let and let
-
which is the unit vector along the line, rotated by 90 degrees.
Note that the distance from a point, 10 to the line is given past
-
And and so the squared distance from a point, x, to a line is
-
The sum of squared distances to many lines is the cost part:
-
This can be rearranged:
-
To find the minimum, nosotros differentiate with respect to x and ready the effect equal to the aught vector:
-
so
-
and so
-
In more than than ii dimensions [edit]
While is non well-defined in more than ii dimensions, this can be generalized to whatever number of dimensions by noting that is merely the (symmetric) matrix with all eigenvalues unity except for a zero eigenvalue in the management along the line providing a seminorm on the distance between and another point giving the distance to the line. In any number of dimensions, if is a unit vector along the i-th line, then
- becomes
where I is the identity matrix, and so[4]
-
General derivation [edit]
In order to find the intersection bespeak of a ready of lines, we calculate the point with minimum distance to them. Each line is defined by an origin and a unit direction vector, . The square of the distance from a point to i of the lines is given from Pythagoras:
-
Where : is the projection of on the line . The sum of distances to the foursquare to all lines is:
-
To minimize this expression, we differentiate it with respect to .
-
-
It results:
-
Where is the identity matrix. This is a matrix , with solution , where is the pseudo-inverse of .
See as well [edit]
- Line segment intersection
- Line intersection in projective space
- Altitude betwixt two parallel lines
- Distance from a point to a line
- Line–airplane intersection
- Parallel postulate
- Triangulation (computer vision)
- Intersection (Euclidean geometry) § 2 line segments
References [edit]
- ^ "Weisstein, Eric W. "Line-Line Intersection." From MathWorld". A Wolfram Web Resource . Retrieved 2008-01-ten .
- ^ Antonio, Franklin (1992). "Chapter IV.vi: Faster Line Segment Intersection". In Kirk, David (ed.). Graphics Gems III. Academic Press, Inc. pp. 199–202. ISBN0-12-059756-X.
- ^ "Homogeneous coordinates". robotics.stanford.edu . Retrieved 2015-08-eighteen .
- ^ Traa, Johannes. "To the lowest degree-Squares Intersection of Lines" (PDF) . Retrieved 30 August 2018.
External links [edit]
- Distance betwixt Lines and Segments with their Closest Point of Arroyo, applicable to two, 3, or more dimensions.
0 Response to "P Can Be Computed as the Intersection Point Between Two Lines Triangulation"
Post a Comment