package lab1;

import java.lang.Math;

public class PhysicsUtilityTester {
	
	public static void main(String[] args) {
		
		if (Math.abs(PhysicsUtility.G - 6.67e-11) > 1e-11)
			done();

		if (Math.abs(PhysicsUtility.radiusEarth - 6.37e6) > 1e6)
			done();

		if (Math.abs(PhysicsUtility.massEarth - 5.97e24) > 1e24)
			done();
		
		double m1 = 1.0;
		double m2 = 2.0;
		double r = 3.0;
		double result = PhysicsUtility.G*m1*m2/r/r;
		if (Math.abs(PhysicsUtility.gravitationalForce(m1, m2, r) - result) > (result/1e9))
			done();
		
		m2 = PhysicsUtility.massEarth;
		r = PhysicsUtility.radiusEarth;
		result = PhysicsUtility.G*m1*m2/r/r;
		if (Math.abs(PhysicsUtility.earthSurfaceForce(m1) - result) > (result/1e9))
			done();
		
		System.out.println("AllGood");
		
		
	}
	
	public static void done() {
		System.out.println("NoGood");
		System.exit(0);
	}

}
