New Member FAQ | Forums | Earn Revenue | Posting Guidelines | Help Topics | Admissions 2013
Awards & Gifts
 
Login Login    Register      

ArticlesPractice TestsAsk ExpertsQuestion PapersJobsUniversitiesCollegesCoursesSchoolsTraining

Active Members
TodayLast 7 Daysmore...

Join our online Google+ community for Bloggers, Content Writers and Webmasters




BRESENHAM’S CIRCLE DRAWING ALGORITHM


Posted Date:     Total Responses: 0    Posted By: vishnuvardan   Member Level: Gold   Points/Cash: 4   


#include
#include
#include
#include
#include
class Circle
{
private:
int gd,gm,x,y,r;
float d;
public:
void get();
void bres();
Circle();
~Circle();
}
Circle::Circle()
{
gd=DETECT;
initgraph(&gd,&gm,"K:\\tc\\bgi");
}
void Circle::get()
{
outtextxy(10,30,"Enter the radius of circle");
cin>>r;
}
Circle::~Circle()
{
closegraph();
}
void Circle::bres()
{
cleardevice();
outtextxy(100,10,"Bresenham's circle drawing algorithm");
get();
x=0;y=r;d=3-(2*r);
do
{
putpixel(200+x,200+y,15);
putpixel(200+y,200+x,15);
putpixel(200+y,200-x,15);
putpixel(200+x,200-y,15);
putpixel(200-x,200-y,15);
putpixel(200-y,200-x,15);
putpixel(200-y,200+x,15);
putpixel(200-x,200+y,15);
if(d<=0)
d=d+(4*x)+6;
else
{
d=d+(4*(x-y))+10;
y=y-1;
}
x++;
delay(10);

} while(x }
void main()
{
clrscr();
Circle c;
c.bres();
getch();
}

Attachments

  • bresenham circle drawing algorithm (2190-17254-BRESENHAM circle.doc)

  • Project Feedbacks


    No feedbacks found. Be the first to respond...

    Post Feedback
    You must Sign In to post a feedback.
    Next Project: Text And Speech Project
    Previous Project: RUN TIME STORAGE MANAGEMENT

    Return to Project Index

    Post New Project


    Related Projects

    Subscribe to Email
  • Get Jobs by Email
  • Forum posts by Email
  • Articles by Email
  • Online MembersHafeez
    Runa N Borah
    Adesola Adeyeye
    Sameer
    K Mohan
    Lakshmi Narayan
    Ani Abhishek Srivastava
    Hemnath
    Seshi
    Farid Akhtar
    Riamerin
    More...


    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    AdSense Revenue Sharing sites   Advertise   Talk to Tony John
    ISC Technologies, Kochi - India. Copyright © All Rights Reserved.