I got found the maths package, but I can't find out how to use them. Help?


1 2 3 4 5 6 7 8 9 | static double x, y; GreenfootImage line= new GreenfootImage( 600 , 600 ); public void act() { y=Math.sin(x); line.setColor(Color.RED); line.drawLine(( int )x,( int )y,( int )x,( int )y); setImage(line); } |
1 | y = Math.sin(( double ) 0.5 ); |
1 | line.drawLine(( int )x, ( int )y, ( int )(x + 1 ), ( int )y); |