Inaccurate trigonometry table

The vanilla Doom engine uses pre-built for  trigonometry. In former versions of the code, the tables were generated on the fly at startup by the functions  and   in r_main.c. In more recent versions (such as the linuxdoom-1.10 tarball), the tables are precompiled and stored in the tables.c file.

The Doom engine represents an angle as a 32-bit value, giving it 2^32 (4294967296) possible angle values. There cannot be that many values in a table, so the precision is first reduced to 2^13 (8192) possible values (the "fine angles") for the sine and cosine lookup table. Therefore, each entry corresponds to 2^19 (524288) different angles. The tangent table is even smaller, with only 2048 unique values.

For all of these ranges, the precise value that was used to generate the entry in the table is the middle one corresponding to the one in the middle of the range. The result is that there is a 0.02197265625° difference (one half of 360/8192) between the "rounded" angle value and the angle used to compute the result.

One of the outcomes of this inaccuracy is that orthogonal movement is not possible.