Example #1
0
        public void TestDegree()
        {
            DegreeUnit val1 = 100d;
            DegreeUnit val2 = 10d;

            Assert.AreEqual(110d, (val1 + val2).Value);
            Assert.AreEqual(90d, (val1 - val2).Value);
            Assert.AreEqual(1000d, (val1 * val2).Value);
            Assert.AreEqual(10d, (val1 / val2).Value);
        }
Example #2
0
        public void TestRadianDegree()
        {
            DegreeUnit degree = 45d;
            RadianUnit radian = 0.3d;

            Assert.AreEqual(45d + (180 * 0.3d / Math.PI), (degree + radian).Value);
            Assert.AreEqual(45d - (180 * 0.3d / Math.PI), (degree - radian).Value);
            Assert.AreEqual(45d * (180 * 0.3d / Math.PI), (degree * radian).Value);
            Assert.AreEqual(45d / (180 * 0.3d / Math.PI), (degree / radian).Value);

            Assert.AreEqual(0.3d + (Math.PI * 45d / 180), (radian + degree).Value);
            Assert.AreEqual(0.3d - (Math.PI * 45d / 180), (radian - degree).Value);
            Assert.AreEqual(0.3d * (Math.PI * 45d / 180), (radian * degree).Value);
            Assert.AreEqual(0.3d / (Math.PI * 45d / 180), (radian / degree).Value);

            Assert.IsTrue(degree > radian);
            Assert.IsTrue(radian < degree);
            Assert.IsFalse(degree < radian);
            Assert.IsFalse(radian > degree);
        }
Example #3
0
 public Quaternion3D(DegreeUnit angle, Vector3D axis)
 {
     AngleDegree = angle;
     Axis = axis;
 }