Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

. . . 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)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: