Advertisement
ExIsTeR

AlgoritmiGeometrici/ InitAxe2D

May 22nd, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. int xe(float x)// normalizarea coordonatei x
  2. {
  3.     return((int)floor((x - x_1) / (x_2 - x_1)*x_max));
  4. }
  5. int ye(float y)// normalizarea coordonatei y
  6. {
  7.     return((int)floor((y_2 - y) / (y_2 - y_1)*y_max));
  8. }
  9. void axe2D()
  10. {
  11.     setcolor(0);
  12.     outtextxy(xe(x_2) - 20, ye(0) - 20, "x");
  13.     outtextxy(xe(x_2) - 18, ye(0) - 7, ">");
  14.     outtextxy(xe(0) - 15, ye(y_2) + 15, "y");
  15.     outtextxy(xe(0) - 15, ye(0) - 15, "O");
  16.     outtextxy(xe(0) - 1, ye(y_2), "^");
  17.     line(xe(x_1), ye(0), xe(x_2), ye(0));
  18.     line(xe(0), ye(y_1), xe(0), ye(y_2));
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement