Esempio n. 1
0
        public void GetKMuForceTest1()
        {
            var me     = new VelPosDummy(1, 2, 3, 0, 0, 0);
            var toThis = new VelPosDummy(3, 4, 5, 0, 0, 0);

            var diag = Math.Sqrt(3);
            var f    = Phys3DHelper.GetKMuForce(me, toThis, 10, 10, 2 * diag);

            Assert.IsTrue(Vector3D.ApproxEqual(f, Vector3D.Zero, 0.00000001));
        }
Esempio n. 2
0
        public void GetKMuForceTest5()
        {
            var me     = new VelPosDummy(0, 0, 0, 0, 7, 77);
            var toThis = new VelPosDummy(7, 0, 0, 0, -99, 199);

            var diag = 7;

            var f = Phys3DHelper.GetKMuForce(me, toThis, 10, 10, 1 * diag);

            Assert.AreEqual(0, f.X, 0.00001);
            Assert.AreEqual(0, f.Y, 0.00001);
            Assert.AreEqual(0, f.Z, 0.00001);
        }
Esempio n. 3
0
        public void GetKMuForceTest2()
        {
            var me     = new VelPosDummy(1, 2, 3, 0, 0, 0);
            var toThis = new VelPosDummy(3, 4, 5, 0, 0, 0);

            var diag = Math.Sqrt(3);

            var f = Phys3DHelper.GetKMuForce(me, toThis, 10, 10, 3 * diag);

            Assert.AreEqual(diag * 10, f.GetLength(), 0.00001);
            Assert.AreEqual(-10, f.X, 0.00001);
            Assert.AreEqual(-10, f.Y, 0.00001);
            Assert.AreEqual(-10, f.Z, 0.00001);
        }
Esempio n. 4
0
        public void GetKMuForceTest3()
        {
            var me     = new VelPosDummy(1, 2, 3, 0, 0, 0);
            var toThis = new VelPosDummy(3, 4, 5, 0, 0, 0);

            var diag = Math.Sqrt(3);
            var f    = Phys3DHelper.GetKMuForce(me, toThis, 10, 10, 2 * diag);

            Assert.IsTrue(Vector3D.ApproxEqual(f, Vector3D.Zero, 0.00000001));

            me.Vel.Vec3D = new Vector3D(1, 1, 1);

            f = Phys3DHelper.GetKMuForce(me, toThis, 10, 10, 2 * diag);
            Assert.AreEqual(diag * 10, f.GetLength(), 0.00001);
            Assert.AreEqual(-10, f.X, 0.00001);
            Assert.AreEqual(-10, f.Y, 0.00001);
            Assert.AreEqual(-10, f.Z, 0.00001);
        }