# | Line 19 | Line 19 | register FVECT v; | |
---|---|---|
19 | { | |
20 | static double len; | |
21 | ||
22 | < | len = v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; |
22 | > | len = DOT(v, v); |
23 | ||
24 | if (len <= 0.0) | |
25 | return(0.0); | |
26 | ||
27 | < | len = sqrt(len); |
27 | > | if (len <= 1.0+FTINY && len >= 1.0-FTINY) |
28 | > | len = 0.5 + 0.5*len; /* first order approximation */ |
29 | > | else |
30 | > | len = sqrt(len); |
31 | ||
32 | v[0] /= len; | |
33 | v[1] /= len; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |