Can anyone help me out with rotating a line about a fixed point?
say Like x,y = 100 and length of line is 10. (By rotation, It draws a circle of radius 10). To be clear, I have a circle of radius 10. I imagine it to be a wheel of a car. I need to rotate a line from the center to the circumference of the circle as the car is moving forward.
My code for moving a 2-d Car from left to right is below.
Please help me out :)Code:#include<graphics.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"e:\\lab\\tc\\bgi");
for(i=100;i<400;i++)
{
setcolor(3);
line(i,100,i+15,85); //RISING LINE
line(i+15,85,i+70,85); //ST.LINE AT TOP
line(i+70,85,i+100,100); //FALLING LINE
rectangle(i+100,150,i,100); //BODY
rectangle(i+10,130,i+30,110); //WINDOW1
rectangle(i+40,130,i+60,110); //WINDOW2
rectangle(i+70,130,i+90,110); //WINDOW3
circle(i+15,125,5); //FACE1
circle(i+45,125,5); //FACE2
circle(i+75,125,5); //FACE3
circle(i+20,160,10); //WHEEL1
circle(i+80,160,10); //WHEEL2
delay(25);
cleardevice();
}
closegraph();
}

