SepetPhalanx
04-12-2005, 01:26 PM
I have a program, at home (otherwise I would show you it), that draws a spirograph type of drawing by connecting two points.
I want to use drawLine to plot points that are 5 degrees apart without the lines connecting them:
drawLine(int, int, int, int)
but the my calculations for the integers are something like:
double x, y;
int r = 100; //raduis
for (int num = 5; num < 360; num +=5){
x = r*cos(num); //x coord
y = r*sin(num); //y coord
}
I don't remember exactly what the algerythm is but I know it works because when it draws a very rough circle as you might imagine because it rounds the double to a integer somewhere (either to make itself happy or maybe I programmed it that way JUST so it'll compile and execute I don't remember exactly) the only thing I need is something like drawLine(double, double, double, double). Hopefully something like this will cooperate with the applet.
ANY info regarding this will be much appreciated. I can put the algerythem on this thread later tonight (I am posting this at almost 12:30 my time so you have a bit of waiting to do if you need to see it :p )
Thanks
I want to use drawLine to plot points that are 5 degrees apart without the lines connecting them:
drawLine(int, int, int, int)
but the my calculations for the integers are something like:
double x, y;
int r = 100; //raduis
for (int num = 5; num < 360; num +=5){
x = r*cos(num); //x coord
y = r*sin(num); //y coord
}
I don't remember exactly what the algerythm is but I know it works because when it draws a very rough circle as you might imagine because it rounds the double to a integer somewhere (either to make itself happy or maybe I programmed it that way JUST so it'll compile and execute I don't remember exactly) the only thing I need is something like drawLine(double, double, double, double). Hopefully something like this will cooperate with the applet.
ANY info regarding this will be much appreciated. I can put the algerythem on this thread later tonight (I am posting this at almost 12:30 my time so you have a bit of waiting to do if you need to see it :p )
Thanks