Three points $(x_1,y_1), (x_2,y_2)$ and $(x_3,y_3)$ whether fall in a straight line or not. How do I do that?
This answer is about approximate collinearity, and can be used when the coordinates are not exact (floating-point).
The angle between the line segments $12$ and $23$ is given by
To compare this angle to a small tolerance $\delta$, we cancompare the tangents, like
This can be rewritten as
On the left, you recognize a cross product (double area of the triangle) and on the right a dot product (giving a relative area information).
Obviously, with $\delta=0$, you find the same expression as in the other posts.