Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int xe(float x)// normalizarea coordonatei x
- {
- return((int)floor((x - x_1) / (x_2 - x_1)*x_max));
- }
- int ye(float y)// normalizarea coordonatei y
- {
- return((int)floor((y_2 - y) / (y_2 - y_1)*y_max));
- }
- void axe2D()
- {
- setcolor(0);
- outtextxy(xe(x_2) - 20, ye(0) - 20, "x");
- outtextxy(xe(x_2) - 18, ye(0) - 7, ">");
- outtextxy(xe(0) - 15, ye(y_2) + 15, "y");
- outtextxy(xe(0) - 15, ye(0) - 15, "O");
- outtextxy(xe(0) - 1, ye(y_2), "^");
- line(xe(x_1), ye(0), xe(x_2), ye(0));
- line(xe(0), ye(y_1), xe(0), ye(y_2));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement