cg recd wrk

Upload: sree7krish

Post on 09-Oct-2015

80 views

Category:

Documents


0 download

DESCRIPTION

computer graphics record

TRANSCRIPT

Ex. No: 1.a)Implementation of Line- Bresenhams AlgorithmDate:

Aim:To write a C++ program to implement Bresenhams Algorithm to draw a line.Algorithm:Step 1: Start the program.Step 2: Include necessary header files for graphics programming.Step 3: Define the variables gd & gm, and set the path C:\\tc\\bgi.Step 4: Get the values for co-ordinates (x1,y1) and (x2,y2) from the user.Step 5: Calculate the values of dx,dy and p.Step 6: Check the if condition and assign values accordingly.Step 7: The condition is If(p