Returns the sine of the given angle. Linearly interpolates between two entries in a 256-entry table
| 101 | |
| 102 | // Returns the sine of the given angle. Linearly interpolates between two entries in a 256-entry table |
| 103 | float FixSin(angle a) { |
| 104 | int i, f; |
| 105 | float s0, s1; |
| 106 | |
| 107 | i = (a >> 8) & 0xff; |
| 108 | f = a & 0xff; |
| 109 | |
| 110 | s0 = sincos_table[i]; |
| 111 | s1 = sincos_table[i + 1]; |
| 112 | return (float)(s0 + ((s1 - s0) * (double)f / 256.0)); |
| 113 | } |
| 114 | |
| 115 | // Returns the cosine of the given angle. Linearly interpolates between two entries in a 256-entry table |
| 116 | float FixCos(angle a) { |
no outgoing calls
no test coverage detected