Search & Find out

Thursday, December 3, 2009

Reflection of circle

#include "stdio.h"
#include "conio.h"
#include "graphics.h"
void main()
{
    int gd,gm;
    int maxx,maxy,x,y,r;
    clrscr ();
    printf ("Enter the coordinates: ");
    scanf ("%d%d",&x,&y);
    printf ("Enter the radius: ");
    scanf ("%d",&r);
    detectgraph (&gd,&gm);
    initgraph (&gd,&gm,"c:\\TC\\BGI");
    maxx = getmaxx();
    maxy = getmaxy();
    line (0,maxy/2,maxx,maxy/2);
    line (maxx/2,0,maxx/2,maxy);
    circle (x+maxx/2,y+maxy/2,r);
    setcolor (2);
    circle (x+maxx/2,-y+maxy/2,r);
    setcolor (11);
    circle (-x+maxx/2,y+maxy/2,r);
    setcolor (14);
    circle (-x+maxx/2,-y+maxy/2,r);
getch ();
closegraph ();
}


Download the executable (.exe)  file for this program..
download



0 comments:

Post a Comment

 

My Blog List

Term of Use