Add to Favorites    Make Home Page 474 Online  
 Language Categories  
 Our Services  

Home » C++ Home » Computer Graphics Home » Program to implement DDA Circle Drawing Algorithm.

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Program to implement DDA Circle Drawing Algorithm.
Description
Category C++ » Computer Graphics
Hits 400692
Code Select and Copy the Code
#include<iostream.h> #include<graphics.h> #include<conio.h> #include<math.h> #include<dos.h> #include<stdlib.h> #include<stdio.h> class myCircle { private: float x,y,r,d,x1,y1; public: myCircle(); //Constructor void showCircle(); int sign(int); }; int myCircle::sign(int xx) { if(xx<0) return -1; if(xx==0) return 0; if(xx>0) return 1; return 0; } myCircle::myCircle() { x=0;y=0; cout<<" "Enter The Co-Ordinates Of The Circle ":="; cin>>x1>>y1; cout<<" "Enter The Radius Of The Circle ":="; cin>>r; } void myCircle::showCircle() { char *s; int s1,s2,ic; x=x1;y=y1; float i=0; while(i<=360) { x=x1+r*cos(i); y=y1+r*sin(i); putpixel((x+320),480-(y+240),6); i+=0.5; } setcolor(15); sprintf(s,"Center(%d,%d)",x1,y1); outtextxy(40,10,"The Center Is At :="); outtextxy(40,20,s); sprintf(s,"Radius=%g",r); outtextxy(40,30,s); getch(); } void main() { int gd=DETECT,gm,i,j,xx=220,xxx=430; clrscr(); myCircle a; char *mess[]={"D","D","A"," ","C","I","R","C","L","E"," ","A","L","G","O","R","I","T","H","M"}; initgraph(&gd,&gm,"..\bgi"); cleardevice(); rectangle(120,40,320,240); rectangle(320,40,520,240); rectangle(120,240,320,440); rectangle(320,240,520,440); for(i=0,j=19;i<12,j>=10;i++,j--) { xx+=10; outtextxy(xx,10,mess[i]); xxx-=10; outtextxy(xxx,10,mess[j]); delay(100); } for(i=130;i<=510;i+=10) for(j=50;j<=430;j+=10) putpixel(i,j,15); for(i=130;i<=510;i+=10) { if(i==320) continue; outtextxy(i,237,"+"); } for(i=50;i<=430;i+=10) { if(i==240) continue; outtextxy(317,i,"-"); } outtextxy(310,230,"O"); outtextxy(530,240,"X"); outtextxy(320,450,"-Y"); outtextxy(100,240,"-X"); outtextxy(320,30,"Y"); a.showCircle(); closegraph(); }

Related Source Codes

Script Name Author
Moving ball screen saver karlmarx
The Classic Game of Snake & Ladder Lakshmi Narayana .A
Railway seat reservation question which comes in sapient VyomWorld
To calculate percentile Ravi Mathur
Send to folder ANIMESH SAHU
Analog clock and calendar Nazia & Rida
HIGH/LOW GAME MOLLY ARORA
Data structure (stack Implimentation) Swapnil B Adsure
Memory Game AnirudhSanyal
Easy Calc Anirudh Sanyal
GK Quiz Anirudh Sanyal
Hangman Game Manish Jain
Snakeman Manish Jain
Full month Calendar Nigi
Cursor shapes nigi

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=117


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review