I'm struggling to understand how Chocolate Doom assigns its cosine table. The comments explain that it does a PI/2 shift on the sine table in order to calculate the cosine table, but I don't understand how it's done using C.
Here is Chocolate Doom's original source code in tables.h and tables.c
#define FINEANGLES 8192
const fixed_t finesine[10240] =
{
25,75,125,175,226,276,326,376,
...
}
const fixed_t *finecosine = &finesine[FINEANGLES/4];
This is what I'm trying to achieve in Kotlin
val fineSine: Array<Fixed_t> = arrayOf(25,75,125,175,226,276,326,376, ...)
val fineCosine: Array<Fixed_t> = arrayOf() // This is where I'm stuck