| # | Line 103 | Line 103 | register FVECT v; | |
|---|---|---|
| 103 | if (len <= 0.0) | |
| 104 | return(0.0); | |
| 105 | ||
| 106 | < | /****** problematic |
| 107 | < | if (len >= (1.0-FTINY)*(1.0-FTINY) && |
| 108 | < | len <= (1.0+FTINY)*(1.0+FTINY)) |
| 109 | < | return(1.0); |
| 110 | < | ******/ |
| 106 | > | if (len <= 1.0+FTINY && len >= 1.0-FTINY) |
| 107 | > | len = 0.5 + 0.5*len; /* first order approximation */ |
| 108 | > | else |
| 109 | > | len = sqrt(len); |
| 110 | ||
| 112 | – | len = sqrt(len); |
| 111 | v[0] /= len; | |
| 112 | v[1] /= len; | |
| 113 | v[2] /= len; | |
| 114 | + | |
| 115 | return(len); | |
| 116 | } | |
| 117 | ||
| – | Removed lines |
| + | Added lines |
| < | Changed lines (old) |
| > | Changed lines (new) |