We dont need any floating point calculation:

for each possible 4 points do the following

```
.
|x1 y1 1 |
|x2 y2 1 | = D1
|x3 y3 1 |
.
```

if the determinant is 0 the points are collinear, so quit.

else the sign of the determinant tells you if they are arranged CW/anti-CW

Now check the determinant

```
.
|x1 y1 x1*x1+y1*y1 1|
|x2 y2 x2*x2+y2*y2 1|
|x3 y3 x3*x3+y3*y3 1| = D2
|x4 y3 x4*x4+y4*y4 1|
.
```

if D1*D2<=0 then the agent is killed.

see my implementation here