Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. int x_cor(float a, float t)
  2. {
  3.     float X = (a * t * t)/(1 + t * t);
  4.     return (int)X;
  5. }
  6.  
  7. int y_cor(float a, float t)
  8. {
  9.     float Y = -(a * t * t * t)/(1 + t * t);
  10.     return (int)Y;
  11. }
  12.  
  13. for (t = -100; t < 100; t += 0.001)
  14.     {
  15.         if (t == -1)
  16.             t++;
  17.         X = x_cor(a, t);
  18.         Y = y_cor(a, t);
  19.         SDL_RenderDrawPoint(renderer, X + null_X, Y + null_Y);
  20.     }
  21. SDL_RenderPresent(renderer);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement