… | |
… | |
184 | static int32_t |
184 | static int32_t |
185 | Sin (int32_t arg) |
185 | Sin (int32_t arg) |
186 | { |
186 | { |
187 | int32_t x = (arg - 360) * 16384 / 360; |
187 | int32_t x = (arg - 360) * 16384 / 360; |
188 | |
188 | |
189 | int c, x2, y; |
189 | int c, y; |
190 | static const int qN = 13, qA = 12, B = 19900, C = 3516; |
190 | static const int qN = 13, qA = 12, B = 19900, C = 3516; |
191 | |
191 | |
192 | c = x << (30 - qN); // Semi-circle info into carry. |
192 | c = x << (30 - qN); // Semi-circle info into carry. |
193 | x -= 1 << qN; // sine -> cosine calc |
193 | x -= 1 << qN; // sine -> cosine calc |
194 | |
194 | |