Wednesday 9 November 2011

Rotation in Computer Graphics


PROGRAM FOR ROTATION IN COMPUTER GRAPHICS

ROTATION PROGRAM
#include<conio.h>
#include<iostream.h>
#include<graphics.h>
#include<math.h>
#include<dos.h>
void main()
{
int x1=100,x2=100,y1=100,y2=300,x12,y12,x22,y22;
float a=1.57;
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
setcolor(5);
line(x1,y1,x2,y2);
while(!kbhit())
{
for(float i=0;i<628;i+=0.1)
{
setcolor(5);
x12=x1*cos(i)-y1*sin(i);
x22=x2*cos(i)-y2*sin(i);
y12=x1*sin(i)+y1*cos(i);
y22=x2*sin(i)+y2*cos(i);
line(x12,y12,x22,y22);
delay(200);
}}
getch();
}


Buy me a Cup of Coffee








MONIKA YADAV (MCA),
Software Engineer,
www.NotesGuru.in, Indore

ROHIT KESHRIYA (MCA),
Software Engineer,
www.NotesGuru.in, Indore

For guest faculty Contact us on following E-mail ID:

monikay.aerosoft@gmail.com
monikay.aerosoft@rediffmail.com
monikay.aerosoft@yahoo.com
monikay.aerosoft@hotmail.com
rohit.aerosoft@gmail.com
rohit.aerosoft@rediffmail.com
rohit.aerosoft@yahoo.com
rohit.aerosoft@hotmail.com

Note: We have been used search engines for gathering content.



















Your Ad Here







free counters

No comments:

Post a Comment