Successfully reported this slideshow.
Upcoming SlideShare
×

# COMPUTER GRAPHICS

103 views

Published on

THIS PDF FILE CONSISTS OF BASIC PROGRAM OF COMPUTER GRAPHICS.

Published in: Education
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

### COMPUTER GRAPHICS

1. 1. scanf("%d%d",&x1,&y1) scanf("%d%d",&x2,&y2) dx = x2-x1 dy = y2-y1 steps = abs(dx) steps = abs(dy)
2. 2. OUTPUT : 100 100
3. 3. scanf("%d%d",&x1,&y1) scanf("%d%d",&x2,&y2) dx = x2-x1 dy = y2-y1 p = 2*dy-dx
4. 4. OUTPUT : 100 180
5. 5. p = 1-r
6. 6. OUTPUT: 240
7. 7. OUTPUT : 200
8. 8. OUTPUT: 240 80
9. 9. do scanf("%d",&ch) scanf("%f",&a) outtextxy(250,20,"LINE BEFORE ROTATION")
10. 10. OUTPUT: 100 320 220
11. 11. 80 350 160 80
12. 12. do scanf("%d",&ch) scanf("%d",&a)
13. 13. outtextxy(200,20,"LINE AFTER SCALING");
14. 14. 1 OUTPUT: 100 100 180 180 2
15. 15. n 2 2 0 1 100 300 200 200 300
16. 16. 0
17. 17. scanf("%d",&a)
18. 18. OUTPUT: 200 100 350 100
19. 19. scanf("%d",&a)
20. 20. OUTPUT: 20 1 1 20 100 100
21. 21. do scanf("%d",&ch)
22. 22. "LINE AFTER REFLECTION");
23. 23. "LINE AFTER REFLECTION");
24. 24. OUTPUT: 1 10 10 100 100
25. 25. 0
26. 26. do
27. 27. OUTPUT: 100 80 470 340 180 150 300 280
28. 28. scanf("%d",&wxmin) scanf("%d",&wymin) scanf("%d",&wxmax) scanf("%d",&wymax)
29. 29. OUTPUT:
30. 30. 3 100 100 130 120 50 140
31. 31. do
32. 32. scanf("%d",&n);
33. 33. OUTPUT: 5 n 50 50 200 100 350 350 80 200 40 80 150 150 300 300
34. 34. 12.