Advertisement
Sorceress

Untitled

Aug 18th, 2018
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. x*x + y*y = r*r
  2. 2*x + 2*y*(dy/dx) = 0
  3. dy = -(x/y)*dx
  4.  
  5.  
  6. x=0; y=100 // radius
  7. dx = 1; //pixel
  8. a = y;
  9.  
  10. while(y > x) {
  11. x += dx; a += x;
  12. if(a > y) {a -= y; y--}
  13. plot (x,y); plot (y,x); // one quadrant. repeat for other quadrants
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement