pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

paste-bin - collaborative debugging tool View Help


Posted by sander_l on Wed 17th Jan 10:40 (modification of post by magel view diff)
diff | download | new post

  1. import java.applet.*;
  2. import java.awt.*;
  3. import java.util.Vector;
  4.  
  5. public class K3 extends Applet {
  6.         public void paint(Graphics g) {
  7.                  double t=10.0, i=0.0125, x, y;
  8.                
  9.                 Vector<Integer> vx = new Vector<Integer>(); // loon vektorid vx, vy
  10.                 Vector<Integer> vy = new Vector<Integer>();
  11.                 while (t > -10){
  12.  
  13.                  x = 100.0 * Math.sin(t * Math.PI / 2.0) * Math.cos(t * Math.PI / 10.0)+100;
  14.                  y = (-100.0) * Math.sin(t * Math.PI / 2.0) * Math.sin(t * Math.PI / 10.0)+100;
  15.                       
  16.                  t = t-i;
  17.                  i = i * 1.01;
  18. //lisan x ja y tulemuse vektoritesse t2isarvudena PS! t2isarvudena see p2rast ,et Polygon, tahab punktide korrdinaate
  19.                         vx.add((int)x);
  20.                         vy.add((int)y);
  21.                 }
  22.                
  23. //loon 2 uut massiivi, mx ja my. massiivide pikkus = vektori pikkusega. massiivi pikkus tuleb 2ra m22ratleda.
  24.                 int [] mx = new int[vx.size()];
  25.                 int [] my = new int[vy.size()];
  26.                
  27. // t2idan massiive kasutades for tsyklit. tsykkel kestab seni kuni on j6udnud vx vektori pikkuse l6puni.
  28.                 for(int j = 0; j < vx.size(); j++) {
  29.                         mx[j] = vx.elementAt(j);
  30.                         my[j] = vy.elementAt(j);
  31.                 }
  32.                
  33. // graafiku joonistamine. kasutab andmeid mx, my massiivist ja punktide arvu.
  34.                 g.setColor(Color.red);
  35.                 g.drawPolygon(mx, my, mx.length);
  36.         }
  37. }

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@


Remember my settings