5 ms·
Were you using a CORDIC algorithm? Bit shifts and adds, no multiplies required.
by markrages 7y ago
Were you using a CORDIC algorithm? Bit shifts and adds, no multiplies required.
- keithnz 7y agono, I had hardcoded lookup tables. I was a teen with no real way to find out information about anything and just applied my high school math to the problem :)
- djmips 7y agoYou don't need CORDIC to draw a circle. BTW, I implemented a CORDIC routine in 6502. It would really benefit from a barrel shifter which the 6502 does not have. https://atariage.com/forums/blogs/entry/3385-atan2-in-6502/ https://atariage.com/forums/blogs/entry/3385-atan2-in-6502/ In gist form https://gist.github.com/djmips/29a8fa9099bf92b31a7259da65915de1 https://gist.github.com/djmips/29a8fa9099bf92b31a7259da65915...
- pascal_cuoq 7y agoUsing a CORDIC algorithm would mean having many iterations to compute trigonometric functions for each drawn point (well, for each 8 points considering the symmetries). A variant of the Bresenham line algorithm for circles lets you draw a circle using only a few operations per 8 points (and the operations are also limited to add and shift): https://en.wikipedia.org/wiki/Midpoint_circle_algorithm https://en.wikipedia.org/wiki/Midpoint_circle_algorithm