src/system/math_table.c
Trigonometry tables: a quarter-wave sine, tangents and the quadrants' sines.
Variables
| Name | Description | |
|---|---|---|
const Uint16 | MathSinQuarter [256] | A quarter-wave sine table, scaled by 65536: entry i is the sine of i/1024 of a turn. |
const Uint16 | MathTwoPiSteps [8] | Unused: floor(i * 2π) for i from 0 to 7; nothing reads it. |
const Sint32 | MathQuadrantSin [4] | Unused: the sine at 0, 90, 180 and 270 degrees, in 16.16; nothing reads it. |
const Uint16 | MathTanTable [258] | Tangents scaled by 256: index i is about tan(i * 45 / 128 degrees), so index 128 is tan(45 degrees); the last entries before 90 degrees run high. |
Description
Trigonometry tables: a quarter-wave sine, tangents and the quadrants' sines.
Variables in detail
MathSinQuarter
const Uint16 MathSinQuarter[256]
A quarter-wave sine table, scaled by 65536: entry i is the sine of i/1024 of a turn.
Definition at line 8 of file math_table.c.
MathTwoPiSteps
const Uint16 MathTwoPiSteps[8]
Unused: floor(i * 2π) for i from 0 to 7; nothing reads it.
Definition at line 44 of file math_table.c.
MathQuadrantSin
const Sint32 MathQuadrantSin[4]
Unused: the sine at 0, 90, 180 and 270 degrees, in 16.16; nothing reads it.
References Sint32.
Definition at line 49 of file math_table.c.
MathTanTable
const Uint16 MathTanTable[258]
Tangents scaled by 256: index i is about tan(i * 45 / 128 degrees), so index 128 is tan(45
degrees); the last entries before 90 degrees run high. syAtan starts its binary search at index
127.
Referenced by syAtan().
Definition at line 56 of file math_table.c.