Re:What algorithm blows your mind? (Reddit compsci)
by joe_bleau on Tuesday October 26, 2010 @09:03AM
(#1833995)
CORDIC (http://en.wikipedia.org/wiki/Cordic), used to efficiently calculate trig functions with only very basic hardware requirements (add, sub, shift, and table lookup).
[ Parent
| on HN ]
Re:What algorithm blows your mind? (Reddit compsci)
by hxa7241 on Tuesday October 26, 2010 @11:30AM
(#1834583)
. . . relatedly, from Jim Blinn, from Marvin Minsky -- drawing a circle (near enough), or doing incremental rotation, using just integer add, sub, and two shifts:
N = 128 * 3.14159
X = 1000
Y = 0
MOVE(X,Y)
FOR I = 1 TO N
X = X - (Y >> 6)
Y = Y + (X >> 6)
DRAW(X,Y)