コード例 #1
0
ファイル: Vector3D.cs プロジェクト: pobingwanghai/SharpMapV2
        public void ScalarDivision()
        {
            Vector3D ScalarMultiplicationArgument = new Vector3D(5.0f, 4.0f, 3.0f);
            Assert.IsTrue(ScalarMultiplicationArgument / 2 == new Vector3D(2.5f, 2.0f, 1.5f));
            Assert.IsTrue(2 / ScalarMultiplicationArgument == new Vector3D(2.5f, 2.0f, 1.5f));

            Vector3D Point3 = new Vector3D(12, 18, 24);
            Point3 /= 6;
            Assert.IsTrue(Point3.Equals(new Vector3D(2, 3, 4), .01f));
        }
コード例 #2
0
ファイル: Vector3D.cs プロジェクト: pobingwanghai/SharpMapV2
 public void Rotate()
 {
     Vector3D Test = new Vector3D(0, 1, 0);
     Test.RotateAboutX(System.Math.PI / 2);
     Assert.IsTrue(Test.Equals(new Vector3D(0,0,1), 0.001f));
     Test.RotateAboutY(System.Math.PI / 2);
     Assert.IsTrue(Test.Equals(new Vector3D(1,0,0), 0.001f));
     Test.RotateAboutZ(System.Math.PI / 2);
     Assert.IsTrue(Test.Equals(new Vector3D(0, 1, 0), 0.001f));
 }
コード例 #3
0
ファイル: Vector3D.cs プロジェクト: pobingwanghai/SharpMapV2
        public void ScalarMultiplication()
        {
            Vector3D ScalarMultiplicationArgument = new Vector3D(5.0f, 4.0f, 3.0f);
	        Assert.IsTrue(ScalarMultiplicationArgument*-.5 == -new Vector3D(2.5f, 2.0f, 1.5f));
            Assert.IsTrue(-.5 * ScalarMultiplicationArgument == -new Vector3D(2.5f, 2.0f, 1.5f));
	        Assert.IsTrue(5*ScalarMultiplicationArgument == new Vector3D(25.0f, 20.0f, 15.0f));

            Vector3D Point3 = new Vector3D(2, 3, 4);
            Point3 *= 6;
            Assert.IsTrue(Point3.Equals(new Vector3D(12, 18, 24), .01f));
        }