How to find if the points fall in a straight line or not?

if slopes of lines with any two point will be same , then they are co-linear

i.e. $$\frac{y_2-y_1}{x_2-x_1}=\frac{y_3-y_1}{x_3-x_1}$$


Another way: a certain cross product must be zero, or $$ \left( (x_2-x_1)\hat{i}+(y_2-y_1)\hat{j}\right) \times \left((x_3-x_1) \hat{i}+(y_3-y_1)\hat{j}\right)=\vec{0}$$

$$\implies (x_2-x_1)(y_3-y_1)-(y_2-y_1)(x_3-x_1) = 0$$


Any two points are collinear in the cartesian plane and form an equation of the form $ax+by=c$. Simply test any two distinct pairs of numbers, find the associate $a$ and $b$, and see if they are the same.

Tags:

Geometry