예제 #1
0
 public Vector SubtractVector(Vector vector)
 {
     return new Vector
     {
         X = X - vector.X,
         Y = Y - vector.Y,
         Z = Z - vector.Z
     };
 }
예제 #2
0
 public Vector AddVector(Vector vector)
 {
     return new Vector
     {
         X = X + vector.X,
         Y = Y + vector.Y,
         Z = Z + vector.Z
     };
 }
예제 #3
0
 public Vector FindCrossProduct(Vector bVector)
 {
     return new Vector
     {
         X = (Y*bVector.Z) - (Z*bVector.Y),
         Y = (Z*bVector.X) - (X*bVector.Z),
         Z = (X*bVector.Y) - (Y*bVector.X)
     };
 }
예제 #4
0
 public Point SubtractVector(Vector vector)
 {
     return new Point
     {
         X = X - vector.X,
         Y = Y - vector.Y,
         Z = Z - vector.Z
     };
 }
예제 #5
0
 public Point AddVector(Vector vector)
 {
     return new Point
     {
         X = X + vector.X,
         Y = Y + vector.Y,
         Z = Z + vector.Z
     };
 }
예제 #6
0
        public void FindCrossProduct()
        {
            Console.WriteLine("Finding Cross Product of two Vectors:");
            var aVector = new Vector()
            {
                X = 5,
                Y = 1,
                Z = 4
            };
            aVector.PrintVectorToScreen();

            var bVector = new Vector()
            {
                X = -1,
                Y = 0,
                Z = 2
            };
            bVector.PrintVectorToScreen();

            var cVector = aVector.FindCrossProduct(bVector);
            cVector.PrintVectorToScreen();
        }