News for hackers. Stuff that matters.
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)

There are no comments on this comment yet.