Ejemplo n.º 1
0
        public void Dot()
        {
            Scalar expected = -(Value * Value * 4);

            UnitHelper.RefOperationTester <Vector4D, Vector4D, Scalar>(op1, op2, expected, Vector4D.Dot, "Dot");
            Assert.AreEqual(expected, op1 * op2, "Operator");
            Assert.AreEqual(expected, Vector4D.Dot(op1, op2), "Method");
        }
Ejemplo n.º 2
0
        public void ZCross()
        {
            Assert.AreEqual(0, Vector2D.ZCross(op1, op2), "1");
            Assert.AreEqual(Vector2D.Zero, Vector2D.ZCross(op1, 0), "2");
            Assert.AreEqual(Vector2D.Zero, Vector2D.ZCross(0, op2), "3");
            Assert.AreEqual(new Vector2D(-Value, -Value), Vector2D.ZCross(1, op2), "4");
            Assert.AreEqual(new Vector2D(Value, Value), Vector2D.ZCross(1, op1), "5");
            Assert.AreEqual(new Vector2D(-Value, -Value), Vector2D.ZCross(op1, 1), "6");
            Assert.AreEqual(new Vector2D(Value, Value), Vector2D.ZCross(op2, 1), "7");

            UnitHelper.RefOperationTester <Vector2D, Vector2D, Scalar>(op1, op2, 0, Vector2D.ZCross, "8");
            UnitHelper.RefOperationTester <Vector2D, Scalar, Vector2D>(op1, 1, new Vector2D(-Value, -Value), Vector2D.ZCross, "9");
            UnitHelper.RefOperationTester <Scalar, Vector2D, Vector2D>(1, op2, new Vector2D(-Value, -Value), Vector2D.ZCross, "10");
        }
Ejemplo n.º 3
0
 public void Subtraction()
 {
     Assert.AreEqual(op1 - op1, Vector4D.Zero, "Operator");
     Assert.AreEqual(Vector4D.Zero, Vector4D.Subtract(op1, op1), "Method");
     UnitHelper.RefOperationTester <Vector4D>(op1, op2, op1 - op2, Vector4D.Subtract, "Subtraction");
 }
Ejemplo n.º 4
0
 public void Addition()
 {
     Assert.AreEqual(Vector4D.Zero, op1 + op2, "Operator");
     Assert.AreEqual(Vector4D.Zero, Vector4D.Add(op1, op2), "Method");
     UnitHelper.RefOperationTester <Vector4D>(op1, op2, Vector4D.Zero, Vector4D.Add, "Addition");
 }
Ejemplo n.º 5
0
 public void Max()
 {
     Assert.AreEqual(new Vector4D(Value, Value, Value, Value), Vector4D.Max(op1, op2), "1");
     UnitHelper.RefOperationTester <Vector4D>(op1, op2, new Vector4D(Value, Value, Value, Value), Vector4D.Max, "2");
 }
Ejemplo n.º 6
0
 public void Min()
 {
     Assert.AreEqual(new Vector2D(-Value, -Value), Vector2D.Min(op1, op2), "1");
     UnitHelper.RefOperationTester <Vector2D>(op1, op2, new Vector2D(-Value, -Value), Vector2D.Min, "2");
 }