Dot Product on Matrices and Vectors

By : Torra

I'm trying to get the dot product of two matrices, or vectors. I am using the framework but I can't seem to find anything in the documentation that shows how to do this.

Here's an example:

double[] vector1 = {1,2,3};
double[] vector2 = {3,4,5};

Now I need to multiply them like so:

(1*3) + (2*4) + (3*5)

I assume this is possible, I just can't find the documentation that shows the method used for this.

By : Torra

Shouldn't the following code work?


Documentation url:

Instead of storing the values in an array you could store them in a Vector like :

Vector v1 = new Vector(1,2,3);
Vector v2 = new Vector(3,4,5);
Double crossProduct  = Vector.CrossProduct(vector1, vector2);
By : Shekhar

Here is answer.

double[] vector1 = { 1, 2, 3 };
double[] vector2 = { 3, 4, 5 };
double result = Matrix.Dot(vector1, vector2);
By : JaeWoo So

This video can help you solving your question :)
By: admin