Esempio n. 1
0
        public void AngleTowardTest()
        {
            var v1 = new Vector3D(10, 0, 0);
            var v2 = new Vector3D(2, 5, 0);

            var angv1v2_zplus  = v1.AngleToward(1e-4, v2, Vector3D.ZAxis);
            var angv1v2_zminus = v1.AngleToward(1e-4, v2, -Vector3D.ZAxis);

            var angv2v1_zplus  = v2.AngleToward(1e-4, v1, Vector3D.ZAxis);
            var angv2v1_zminus = v2.AngleToward(1e-4, v1, -Vector3D.ZAxis);

            Assert.True(angv1v2_zplus.EqualsTol(rad_tol, angv2v1_zminus));
            Assert.True(angv1v2_zplus.EqualsTol(rad_tol, 68.1d.ToRad()));

            Assert.True(angv2v1_zplus.EqualsTol(rad_tol, angv1v2_zminus));
            Assert.True(angv2v1_zplus.EqualsTol(rad_tol, 291.8d.ToRad()));
        }