You are on page 1of 29

1.

Drawing objects like circles, rectangles, polygons etc using the graphic function

CIRCLE CODE

OUTPUT

pg. 1
RECTANGLE CODE

OUTPUT

pg. 2
SQUARE CODE

OUTPUT

pg. 3
2. Graphics Inbuilt functions
1) Line function()

CODE:

OUTPUT

pg. 4
2) Bar function()
CODE:

OUTPUT

pg. 5
3. Line Drawing Algorithms (DDA & Bresenham’s Algorithm)

BRESENHAM’S ALGORITHM CODE

pg. 6
OUTPUT

pg. 7
DDA CODE:

OUTPUT

pg. 8
4. Write to implement Circle Algorithms.

BRESENHAM'S CIRCLE DRAWING ALGORITHM CODE:

pg. 9
OUTPUT

MIDPOINT ALGORITHM CODE:

pg. 10
OUTPUT

pg. 11
5. Write to implement Translation in 2D.

Translation in 2D CODE

OUTPUT

pg. 12
6. Write to implement Rotation in 2D

Rotation in 2D CODE

pg. 13
OUTPUT

pg. 14
7. Write to implement Scaling in 2D

scaling in 2D CODE

OUTPUT

pg. 15
8. Write to implement Reflection in 2D

Reflection in 2D CODE

pg. 16
OUTPUT

pg. 17
9. Write to implement Shearing in 2D

Shearing in 2D CODE

OUTPUT

pg. 18
10. Write to implement Cohen Sutherland Algorithm

Cohen Sutherland Algorithm CODE

pg. 19
pg. 20
OUTPUT

pg. 21
11. moving cycle.

Moving a Cycle Code:

OUTPUT

pg. 22
12. Draw a Show Moving Car Animation

Car Animation CODE

pg. 23
OUTPU

pg. 24
13. Write to Making an Analog Clock

Analog Clock CODE:

pg. 25
OUTPUT

pg. 26
14. Write to Show Bouncing Ball Animation

Bouncing Ball Animation CODE:

pg. 27
OUTPUT

pg. 28
11. Program to rotate a circle outside another circle.
CODE:

OUTPUT

pg. 29

You might also like