Originally Posted by
Alex Edwards
Keep in mind what Graphics.drawLine does.
You're trying to draw a point from i to i, and Math.sin(i) to Math.sin(i) so you're going to get something like a line due to the fact that your points aren't varying from x1 to x2 and y1 to y2.
Try g.drawLine(i,(int)Math.sin(i),i + 2,(int)Math.sin(i))));
sorry for quoting myself, but instead of Math.sin(i) use Math.sin(i + ((2 * i)/(2 * Math.PI))) in the last argument.
it might be Math.pi or Math.Pi for the pi constant... bah!
I'm not anywhere near a java compiler atm >_>
Last edited by Alex Edwards; Jun 4th, 2008 at 1:54 am.