5 ms·
The sin/cos lookup tables would only contain an octant of the circle and use various symmetries to map other values to that range. Thus the resolution is ~0.176
by aaaaaaaaaaab 4y ago
The sin/cos lookup tables would only contain an octant of the circle and use various symmetries to map other values to that range. Thus the resolution is ~0.176 degrees for a 256-entry table.
sin(x) = -sin(-x) = sin(pi - x) = cos(pi/2 - x)
cos(x) = cos(-x) = -cos(pi - x) = sin(pi/2 - x)
- LukeShu 4y agoThe limit on precision wasn't the size of the lookup table, it was the size of the integers. The CPU's integers were only 8-bits. So if you're using native integers (i.e.: [0,256) == [0°,360°) ), you can't get angles more precise than 1.4°.