- import java.util.Arrays;
- public class K2 {
- public static void main(String[] args) {
- double t=10.0, samm=0.0125, x, y;
- int h = 0;
- while (t > -10.0)
- {
- t = t-samm;
- samm = samm * 1.01;
- h++;
- }
- double [] mx, my;
- mx = new double[h];
- my = new double[h];
- for(int j = 0; j < h; j++) {
- x = 100.0 * Math.sin(t * Math.PI / 2.0) * Math.cos(t * Math.PI / 10.0);
- y = 100.0 * Math.sin(t * Math.PI / 2.0) * Math.sin(t * Math.PI / 10.0);
- t = t-samm;
- samm = samm * 1.01;
- mx[j] = x;
- my[j] = y;
- }
- Arrays.sort(mx);
- Arrays.sort(my);
- System.out.println("");
- System.out.print("x: ");
- for (int j = 0; j < h; j++) {
- System.out.print(mx[j] + ", ");
- }
- System.out.println("");
- System.out.print("y: ");
- for (int j = 0; j < h; j++) {
- System.out.print(my[j] + ", ");
- }
- }
- }
Posted by magel on Mon 22nd Jan 01:09
download | new post
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.