package astro.galaxy; import java.awt.*; import myutil.*; public class Data { static public double m[]; static public double x[]; static public double y[]; static public double vx[]; static public double vy[]; static public double rad[]; static public Color col[]; static public double[][] as; static public double[][] ac; static public double[][] bs; static public double[][] bc; static public int M=0, N=0, K=0; static public void init(String name, int n, double G) { int i,j,k; double r=0, th=0, v=0; double v_escape=0; double r0=0.01; int n7; n7 = (n<7)?7:n; m = new double[n7]; x = new double[n7]; y = new double[n7]; vx = new double[n7]; vy = new double[n7]; rad = new double[n7]; col = new Color[n7]; as = null; ac = null; bs = null; bc = null; if (name.equals("LagrangeN")) { for (j=0; j7) {n = 7;} m[0] = 200000; m[1] = 5000; m[2]=m[3]=m[4]=m[5]=m[6]=0; x[0] = -0.00125; y[0] = 0; x[1] = 0.05; y[1] = 0; //x[0] = -0.5; y[0] = 0; //x[1] = 1; y[1] = 0; v = Math.sqrt(G*m[0]/x[1])/(x[1]-x[0]); vx[1] = 0; vy[1] = v*x[1]; as = ac = bs = bc = null; // L4 and L5 form an equilateral triangle with two big masses x[2] = (x[0]+x[1])/2; y[2] = (x[1]-x[2])*Math.sqrt(3); x[3] = (x[0]+x[1])/2; y[3] =-(x[1]-x[2])*Math.sqrt(3); th = Math.atan(y[2]/x[2]); a = Math.sqrt(x[2]*x[2]+y[2]*y[2]); vx[2] = -v*a*Math.sin(th); vy[2] = v*a*Math.cos(th); vx[3] = v*a*Math.sin(th); vy[3] = v*a*Math.cos(th); // L2, L3, and L4 x[4] = 6.1003489037265997e-02; y[4] = 0; x[5] = 4.0373442924202974e-02; y[5] = 0; x[6] =-5.1770792333589014e-02; y[6] = 0; vx[4] = 0; vy[4] = v*x[4]; vx[5] = 0; vy[5] = v*x[5]; vx[6] = 0; vy[6] = v*x[6]; rad[0]=4*r0; rad[1]=2*r0; col[0]=Color.yellow; col[1]=Color.blue; col[2]=col[3]=Color.orange; col[4]=col[5]=col[6]=Color.white; for (j=2; j7) {n = 7;} m[0] = 200000; m[1] = 100000; m[2]=m[3]=m[4]=m[5]=m[6]=0; x[0] = -0.025; y[0] = 0; x[1] = 0.05; y[1] = 0; //x[0] = -0.5; y[0] = 0; //x[1] = 1; y[1] = 0; v = Math.sqrt(G*m[0]/x[1])/(x[1]-x[0]); vx[1] = 0; vy[1] = v*x[1]; as = ac = bs = bc = null; // L4 and L5 form an equilateral triangle with two big masses x[2] = (x[0]+x[1])/2; y[2] = (x[1]-x[2])*Math.sqrt(3); x[3] = (x[0]+x[1])/2; y[3] =-(x[1]-x[2])*Math.sqrt(3); th = Math.atan(y[2]/x[2]); a = Math.sqrt(x[2]*x[2]+y[2]*y[2]); vx[2] = -v*a*Math.sin(th); vy[2] = v*a*Math.cos(th); vx[3] = v*a*Math.sin(th); vy[3] = v*a*Math.cos(th); // L2, L3, and L4 x[4] = 9.3678554166024677e-02; y[4] = 0; x[5] = 1.7806367863889522e-02; y[5] = 0; x[6] =-8.5227097049376421e-02; y[6] = 0; vx[4] = 0; vy[4] = v*x[4]; vx[5] = 0; vy[5] = v*x[5]; vx[6] = 0; vy[6] = v*x[6]; rad[0]=4*r0; rad[1]=2*r0; col[0]=Color.yellow; col[1]=Color.blue; col[2]=col[3]=Color.orange; col[4]=col[5]=col[6]=Color.white; for (j=2; j