コード例 #1
0
        public void TestFractionalToCartesian_Vector3d_Vector3d_Vector3d_Point3d()
        {
            Vector3 a          = new Vector3(1.0, 0.0, 0.0);
            Vector3 b          = new Vector3(0.0, 2.0, 0.0);
            Vector3 c          = new Vector3(0.0, 0.0, 3.0);
            Vector3 fractCoord = new Vector3(0.25, 0.50, 0.75);
            Vector3 cartCoord  = CrystalGeometryTools.FractionalToCartesian(a, b, c, fractCoord);

            Assert.AreEqual(0.25, cartCoord.X, 0.001);
            Assert.AreEqual(1.0, cartCoord.Y, 0.001);
            Assert.AreEqual(2.25, cartCoord.Z, 0.001);
        }
コード例 #2
0
        public void TestFractionalToCartesian2()
        {
            Vector3[] cardAxes = CrystalGeometryTools
                                 .NotionalToCartesian(9.3323, 10.1989, 11.2477, 69.043, 74.441, 77.821);
            Vector3 a = cardAxes[0];
            Vector3 b = cardAxes[1];
            Vector3 c = cardAxes[2];

            Vector3 cartCoords = CrystalGeometryTools.FractionalToCartesian(a, b, c, new Vector3(0.517879, 0.258121, 0.698477));

            Assert.AreEqual(7.495, cartCoords.X, 0.001);
            Assert.AreEqual(4.993, cartCoords.Y, 0.001);
            Assert.AreEqual(7.171, cartCoords.Z, 0.001);
        }