In the algorithm for calculating the collinearity of three points, we tried to calculate that the slope of any two straight lines is the same and use Heron's formula to calculate the area to be 0.
The problems encountered are as follows:
The length cannot be expressed accurately. For example, the distance between (1,1) and (2,2) is square root 2 (such a number cannot be expressed in the program). When calculating the area, we get The result is not 0;
Using their squares, which is 2, can be expressed accurately.