static void Main(string[] args)
        {
#if ANGLE_NORM
            angle a = new angle(Math.PI * 3);
            a += Math.PI * 3;
            a += Math.PI;
            a -= Math.PI * 3;
            a -= Math.PI;
#endif
#if VECTOR_ADD
            vector c = new vector(1, 2);
            vector d = new vector(5, 6);
            c += d;
#endif
#if PHYSICS_TEST
            OrbitalPhysics phys = new OrbitalPhysics(OrbitalPhysics.KMKGS);
            phys.RegisterObject(new GravityObject(new vector(1e40, 0), new vector(0, 2), "Object 1"));
            phys.RegisterObject(new GravityObject(new vector(-1e40, 0), new vector(0, -2), "Object 2"));
            for (int i = 0; i < 100; i++)
            {
                phys.Step(10, i * 1e3);
            }
            vector[] pos = phys.VirtualStep(50, 1000, "Object 1");
#endif
        }
Exemple #2
0
 public vector(angle direction, double magnitude)
 {
     this = direction.UnitVector() * magnitude;
 }
Exemple #3
0
 public double Diff(angle b)
 {
     return(CenterNorm(this.ang - b.ang));
 }