Returns the cosine of the given angle. Linearly interpolates between two entries in a 256-entry table
| 114 | |
| 115 | // Returns the cosine of the given angle. Linearly interpolates between two entries in a 256-entry table |
| 116 | float FixCos(angle a) { |
| 117 | int i, f; |
| 118 | float c0, c1; |
| 119 | |
| 120 | i = (a >> 8) & 0xff; |
| 121 | f = a & 0xff; |
| 122 | |
| 123 | c0 = sincos_table[i + 64]; |
| 124 | c1 = sincos_table[i + 64 + 1]; |
| 125 | return (float)(c0 + ((c1 - c0) * (double)f / 256.0)); |
| 126 | } |
| 127 | |
| 128 | // Returns the sine of the given angle, but does no interpolation |
| 129 | float FixSinFast(angle a) { |
no outgoing calls
no test coverage detected