public void CrossProduct() { Vector3D Test1 = new Vector3D(10, 0, 0); Vector3D Test2 = new Vector3D(1, 1, 0); Vector3D CrossResult = Test2.Cross(Test1); Assert.IsTrue(CrossResult.x == 0); Assert.IsTrue(CrossResult.y == 0); Assert.IsTrue(CrossResult.z < 0); }
public void CrossProduct() { Random Rand = new Random(); Vector2D TestVector2D1 = new Vector2D(Rand.NextDouble() * 1000, Rand.NextDouble() * 1000); Vector2D TestVector2D2 = new Vector2D(Rand.NextDouble() * 1000, Rand.NextDouble() * 1000); double Cross2D = TestVector2D1.Cross(TestVector2D2); Vector3D TestVector3D1 = new Vector3D(TestVector2D1.x, TestVector2D1.y, 0); Vector3D TestVector3D2 = new Vector3D(TestVector2D2.x, TestVector2D2.y, 0); Vector3D Cross3D = TestVector3D1.Cross(TestVector3D2); Assert.IsTrue(Cross3D.z == Cross2D); }
public Vector3D Cross(Vector3D B) { Vector3D Temp = new Vector3D(); Temp.Cross(this, B); return Temp; }