Mail Archives: djgpp/1997/02/06/20:02:02
Francois Charton <deef AT pobox DOT oleane DOT com> writes:
>> sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) < sqrt(r1*r1 + r2*r2).
>
>Shouldn't it be :
>sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) < r1 + r2
Oops: you are absolutely right! I should test code before posting it,
sorry everyone...
But my point about leaving out the square root still holds:
sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) < r1+r2
can be reduced down to:
(x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) < (r1+r2)*(r1+r2)
/*
* Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
* Ghoti: 'gh' as in 'enough', 'o' as in 'women', and 'ti' as in 'nation'.
*/
- Raw text -