☖ Home Units Converter Geometry Σ Math Physics Electricity

Collinear 2 dimentional lines - Input 3 points (x , y)

Print collinear 2D lines calculator
Point 1
X1 
Y1 
Point 2
X2 
Y2 
Point 3
X3 
Y3 
Collinear test:
Lines equation:
Area between the points:

Collinear 3 dimentional lines - Input 3 points (x, y, z)

Print collinear 3D lines calculator
Point 1
X1 
Y1 
Z1 
Point 2
X2 
Y2 
Z2 
Point 3
X3 
Y3 
Z3 
Collinear test:
Determinant of the points:
Rank of the determinant:
Parametric lines equation:
Vectors: n1, n2, n3:
Area between the points:
Plane equation:

Colinear 2D points summary

Print colinear points summary

Collinear points are all located on the same line.

Points will be collinear if:
(x_2-x_1)/(x_3-x_1 )=(y_2-y_1)/(y_3-y_1 )

And after rearranging terms to avoid division by zero we get:

(x2 − x1)(y3 − y1) − (x3 − x1)(y2 − y1) = 0

Another way of checking whether the points are collinear is by calculating the area formed by the points, if the area is zero then the points are collinear.

The area is:
Triangle area

A=1/2 [x_1 (y_2-y_3 )-y_1 (x_2-x_3 )+x_2 y_3-x_3 y_2 ]

And after rearranging terms and omitting the value 1/2 we get the condition for collinearity:

x1(y2 − y3) + x2(y3 − y1) + x3(y1 − y2) = 0

Colinear 3D points summary

Print colinear 3D points summary
Point 1:(x1 , y1 , z1)
Point 2:(x2 , y2 , z2)
Point 3:(x3 , y3 , z3)
Collinear 3D points are all located on the same line.

Number of methods can be applied in order to find whether the points are collinear.

Method 1 - If the cross product modulus (magnitude) of the vectors n1 and n2 is zero then the points are collinear, n1 and n2 are the vectors connecting one point to the other two points. This is similar to calculating the area of the triangle by cross product.

A=1/2 |n_1×n_2 |

First vector is:
n1 = (x2 − x1)i + (y2 − y1)j + (z2 − z1)k
Second vector is:
n2 = (x3 − x1)i + (y3 − y1)j + (z3 − z1)k
And the cross product in the x, y and z directions are:
n_1×n_2=|■(i&j&k@x_2-x_1&y_2-y_1&z_2-z_1@x_3-x_1&y_3-y_1&z_3-z_1 )|
x direction (i)       (y2 − y1)(z3 − z1) − (y3 − y1)(z2 − z1) = 0
y direction (j)       (x3 − x1)(z2 − z1) − (x2 − x1)(z3 − z1) = 0
z direction (k)       (x2 − x1)(y3 − y1) − (x3 − x1)(y2 − y1) = 0

Condition of collinearity:       ||n1 × n2 = 0||         (0i + 0j + 0k).

Method 2 - Another method to find the area is by using the 3 points and inserting them into the determinant and then calculating the area (this is the simplest and less steps to find the area) and if the area is 0 then the points are collinear.

A=1/2 |■(x_1&y_1&z_1@x_2&y_2&z_2@x_3&y_3&z_3 )|

Method 3 - Calculating the triangle sides a, b and c by the distance equations:

a=√((x_2-x_1 )^2+(y_2-y_1 )^2+(z_2-z_1 )^2 ) b=√((x_3-x_1 )^2+(y_3-y_1 )^2+(z_3-z_1 )^2 ) c=√((x_3-x_2 )^2+(y_3-y_2 )^2+(z_3-z_2 )^2 )

Check all 3 inequality equations of the triangle sides:       a + b > c       a + c > b       b + c > a

if all the inequalities are true then the points are not collinear.

Second method is by calculating the area by Heron's formula:
A=√(s(s-1)(s-b)(s-c) )

If the area equal 0 then the points are collinear (s - is half the perimeter).

Example 1

Print colinear points summary
Verify that the following points   (-1, 0, 2),   (1, 1, 4),   (3, 2, 6)   are collinear.
We will demonstrate solution by all the methods.

Method 1: Vectors n1 and n2 are:

n1 = (1 + 1)i + (1 - 0)j + (4 - 2)k = 2i + j + 2k
n2 = (3 + 1)i + (2 - 0)j + (6 - 2)k = 4i + 2j + 4k

n_1×n_2=|■(i&j&k@2&1&2@4&2&4)|=(4-4)i-(8-8)j+(4-4)k=0i+0j+0k

‖n_1×n_2 ‖=0^2+0^2+0^2=0

And the points are collinear.

Method 2: Calculating the area between the 3 points:

A=1/2 |■(-1&0&2@1&1&4@3&2&6)|=(-1(6-8)+0+2(2-3))/2=(2-2)/2=0

And the area is 0 therefore the points must be collinear.

Method 3: Calculating the sides a, b and c of the triangle:

a=√((1+1)^2+(1-0)^2+(4-2)^2 )=√9=3 b=√((3+1)^2+(2-0)^2+(6-2)^2 )=√36=6  c=√((3-1)^2+(2-1)^2+(6-4)^2 )=√9=3

We can see that the inequalities are not fulfilled so the points are collinear.

Checking the area between the points by Heron's formula were   S = 6

A=√(S(S-a)(S-b)(S-c) )=√(6(6-3)(6-6)(6-3) )=0

And the area is 0 therefore the points must be collinear.