Top Banner

of 63

CG recd wrk

Oct 09, 2015

Download

Documents

sree7krish

computer graphics record
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
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