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:29 (modification of post by magel view diff)
diff | download | new post

  1. import java.util.Collections;
  2. import java.util.Vector;
  3.  
  4. public class K2 {
  5.         public static void main(String[] args) {
  6.  // loon uued vektorid x ja y jaoks. PS. vektor andmekogum mille pikkust ei pea m22rama.
  7.                 Vector<Double> vx = new Vector<Double>();
  8.                 Vector<Double> vy = new Vector<Double>();
  9.                
  10.                 double t=10.0, samm=0.0125, x, y;
  11.             
  12.               while (t > -10.0){
  13.  
  14.                  x = 100.0 * Math.sin(t * Math.PI / 2.0) * Math.cos(t * Math.PI / 10.0);
  15.                  y = 100.0 * Math.sin(t * Math.PI / 2.0) * Math.sin(t * Math.PI / 10.0);
  16.  
  17.                 
  18.                  t = t-samm; // arvutab t uue v22rtuse.
  19.                  samm = samm * 1.01; // leiab uue sammu.
  20.                 
  21.                         vx.add(x); // lisan tulemuse vx vektorisse.
  22.                         vy.add(y); // lisan tulemuse vy vektorisse.
  23.                 }
  24.                 //sorteerin vektorid
  25.                 Collections.sort(vx);
  26.                 Collections.sort(vy);
  27.  
  28.                 System.out.print("x: "); // v2ljastan p2ise,
  29.                 System.out.println(vx + " ");  // v2ljastan sorteeritud vektori.
  30.                 System.out.print("y: ");
  31.                 System.out.println(vy + " ");
  32.         }
  33. }

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