Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class unbenannt {
- public static void main (String args[]) {
- double x = 512.0;
- double y = 512.0;
- double g = 0; // Winkel
- // Koordinatensystem
- StdDraw.setXscale (0 , 1024.0) ;
- StdDraw.setYscale (0 , 1024.0) ;
- StdDraw.setPenColor(StdDraw.BLACK) ;
- StdDraw.filledSquare ( 0.0 , 0.0 , 1200.0 ) ;
- StdDraw.setPenColor(StdDraw.RED) ;
- while (true) {
- double b = Math.sin(g);
- double a = Math.cos(g) ;
- StdDraw.setPenColor(StdDraw.RED) ;
- StdDraw.line (x,y ,b*512,-a*512);
- g = g + 0.2 ;
- StdDraw.setPenColor(StdDraw.BLACK);
- StdDraw.filledSquare(0.0 , 0.0 , 1200.0 );
- StdDraw.show(20) ;
- }
- }
- }
Add Comment
Please, Sign In to add comment