mirror of
https://github.com/christiaangoossens/Planetary-Orbit-Simulator
synced 2025-07-07 11:20:49 +00:00
Added test
This commit is contained in:
@ -5,7 +5,7 @@ public class SimulatorConfig {
|
||||
* Time settings
|
||||
*/
|
||||
|
||||
public static int rounds = 2147483647; // Amount of rounds to run the simulator for // 3000000 = 250.000 jaar
|
||||
public static int rounds = 530000*2; // Amount of rounds to run the simulator for // 3000000 = 250.000 jaar
|
||||
public static double time = 60 * 60; // Time steps in seconds // 259200 = 1 month
|
||||
|
||||
/**
|
||||
|
17
simulator/src/com/verictas/pos/simulator/Test.java
Normal file
17
simulator/src/com/verictas/pos/simulator/Test.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.verictas.pos.simulator;
|
||||
|
||||
import com.verictas.pos.simulator.mathUtils.AOP;
|
||||
|
||||
import javax.vecmath.Vector3d;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
Vector3d fakePos = new Vector3d(1E20,2E20,3E20);
|
||||
Vector3d fakeSpeed = new Vector3d(4E20,5E20,6E20);
|
||||
|
||||
double aop = AOP.calculate(fakePos, fakeSpeed);
|
||||
System.out.println("END:" + fakePos);
|
||||
System.out.println("END:" + fakeSpeed);
|
||||
System.out.println("END:" + aop);
|
||||
}
|
||||
}
|
@ -7,23 +7,31 @@ public class AOP {
|
||||
Vector3d orbitalMomentum = new Vector3d(0,0,0);
|
||||
orbitalMomentum.cross(speed, pos);
|
||||
|
||||
//System.out.println("h = " + orbitalMomentum);
|
||||
|
||||
// ACCENDING NODE VECTOR
|
||||
Vector3d ascendingNode = new Vector3d(0,0,0);
|
||||
ascendingNode.cross(new Vector3d(0,0,1), orbitalMomentum);
|
||||
|
||||
//System.out.println("n = " + ascendingNode);
|
||||
|
||||
// ECCENTRICITY VECTOR
|
||||
double mu = 1.32712440018E20;
|
||||
// double mu = 1.32712440018E20;
|
||||
double mu = 3.9860044189E14;
|
||||
|
||||
Vector3d upCross = new Vector3d(0,0,0);
|
||||
upCross.cross(speed, orbitalMomentum);
|
||||
upCross.scale(1/mu);
|
||||
//System.out.println("r* x h * 1/mu = " + upCross);
|
||||
|
||||
double posLength = pos.length();
|
||||
Vector3d rightPos = pos;
|
||||
Vector3d rightPos = new Vector3d(pos);
|
||||
rightPos.scale(1/posLength);
|
||||
//System.out.println("r/||r|| = " + rightPos);
|
||||
|
||||
Vector3d eccentricity = new Vector3d(0,0,0);
|
||||
eccentricity.sub(upCross, rightPos);
|
||||
//System.out.println("e = " + eccentricity);
|
||||
|
||||
// AOP
|
||||
double aop;
|
||||
|
Reference in New Issue
Block a user