java - Precision issues in three-point collinearity and other point-based algorithms
为情所困
为情所困 2017-05-27 17:40:03
0
1
596

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;

为情所困
为情所困

reply all(1)
phpcn_u1582

Using their squares, which is 2, can be expressed accurately.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template