Guest User

Untitled

a guest
Apr 23rd, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1.  
  2. public class unbenannt {
  3.    
  4.     public static void main (String args[]) {
  5.    
  6.    
  7.    double x = 512.0;
  8.    double y = 512.0;
  9.    double g = 0;   // Winkel
  10.    
  11.  
  12.  
  13.  // Koordinatensystem
  14.  StdDraw.setXscale (0 , 1024.0) ;
  15.  StdDraw.setYscale (0 , 1024.0) ;
  16.    
  17.        StdDraw.setPenColor(StdDraw.BLACK) ;
  18.        StdDraw.filledSquare ( 0.0 , 0.0 , 1200.0 ) ;
  19.        StdDraw.setPenColor(StdDraw.RED) ;
  20.  
  21.        
  22.        while (true) {
  23.            
  24.   double b = Math.sin(g);
  25.   double a = Math.cos(g)  ;  
  26.    
  27.    
  28.     StdDraw.setPenColor(StdDraw.RED) ;         
  29.     StdDraw.line (x,y ,b*512,-a*512);
  30.          g = g + 0.2 ;  
  31.          
  32.    
  33.            
  34.          StdDraw.setPenColor(StdDraw.BLACK);
  35.          StdDraw.filledSquare(0.0 , 0.0 , 1200.0 );
  36.            
  37.          StdDraw.show(20) ;
  38.          
  39.        
  40.          
  41.        
  42.          
  43.        
  44.          
  45.        
  46.        
  47.        }
  48.  
  49.  
  50.      
  51.      
  52.      
  53.  
  54. }
  55.        
  56.    
  57.  
  58.    
  59. }
Add Comment
Please, Sign In to add comment