Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.91 KB | None | 0 0
  1. stock Test(Float:radius, Float:start_pos_x, Float:start_pos_y)
  2. {
  3.     new Float:x,
  4.         Float:y = radius,
  5.         Float:delta = 1.0-2.0*radius,
  6.         Float:error = 0.0,
  7.         Float:x1, Float:y1,
  8.         Float:x2, Float:y2,
  9.         Float:x3, Float:y3,
  10.         Float:x4, Float:y4;
  11.     while (y >= 0.0)
  12.     {
  13.         x1 = start_pos_x + x;
  14.         y1 = start_pos_y + y;
  15.         x2 = start_pos_x + x;
  16.         y2 = start_pos_y - y;
  17.         x3 = start_pos_x - x;
  18.         y3 = start_pos_y + y;
  19.         x4 = start_pos_x - x;
  20.         y4 = start_pos_y - y;
  21.  
  22.         print("===================");
  23.         printf("x = %f | y = %f", x1, y1);
  24.         printf("x = %f | y = %f", x2, y2);
  25.         printf("x = %f | y = %f", x3, y3);
  26.         printf("x = %f | y = %f", x4, y4);
  27.  
  28.         error = 2.0 * (delta + y) - 1.0;
  29.         if((delta < 0.0) && (error <= 0.0))
  30.         {
  31.             delta += 2.0 * ++x + 1.0;
  32.             continue;
  33.         }
  34.         else if((delta > 0.0) && (error > 0.0))
  35.         {
  36.             delta -= 2.0 * --y + 1.0;
  37.             continue;
  38.         }
  39.         delta += 2.0 * (++x - y--);
  40.     }
  41.     return;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement