trajectory of circles moving

Hello, I'm new to c++ and I made a program of one circle rolling another one. Now, I don't know how to make the trajectory of the smaller one depending on its radius. It must look like a cardioid or like a flower, depending of the value of the radius. This is the program I have until now:

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<process.h>
#include<math.h>
#include<dos.h>
#define ROUND(a) (int) (a+0.5)
void main()
{
int i,ang;
float OX,OY;
int DIM=DETECT,MIM,errorcode;
clrscr();
initgraph(&DIM, &MIM, "c:\\tc\\bgi");
errorcode=graphresult();
if(errorcode!=grOk)
{
printf("Graphics Error : %s\n", grapherrormsg(errorcode));
printf("Press any key to continue..");
getch();
exit(1);
}
while(!kbhit())
{
for(i=0;i<=360;i++)
{
circle(250,250,100);
OX=375;
OY=250;
OX=250+130*sin(i*3.14/180);
OY=250-130*cos(i*3.14/180);
//ROUND(OX);
//ROUND(OY);
circle(OX,OY,30);
delay(10);
clearviewport();
}
}
getch();
}
Can someone help me with some explainings or some examples?
Last edited on
Topic archived. No new replies allowed.