Then the cross product is equals to (a2 * b3 – a3 * b2) * i - (a1 * b3 – a3 * b1) * j + (a1 * b2 – a2 * b1) * k, where a2 * b3 – a3 * b2, a1 * b3 – a3 * b1 and a1 * b1 – a2 * b1 are the coefficient of unit vector and i, j and k are the directions of the vector. Let’s say we have two vectors A = a1 * i + a2 * j + a3 * k and B = b1 * i + b2 * j + b3 * k. Let’s say we have two vectors A = a1 * i + a2 * j + a3 * k and B = b1 * i + b2 * j + b3 * k where i, j and k are the unit vectors which means they have value as 1 and x, y and z are the directions of the vector then dot product or scalar product is equals to a1 * b1 + a2 * b2 + a3 * b3 Input-: A = 2 * i + 7 * j + 2 * kĬross product is also known as the vector product which is defined as − We will write a CUDA program to multiply two vectors, each having 10000 elements. The dot product is also known as the scalar product which is defined as − Comparison of execution time for CPU and GPU. Equal vector − if two vectors have the same magnitude and direction then they are said to be equal vector.Collinear vector − if two or more vectors are parallel to the same line then they are said to be collinear vector.Coinitial vector − If two or more vectors have the same initial point or the starting point then they are said to be coinitial vector.With some simplification, we find our result is a vector with an component of 3 and a component of 2 4. Zero vector − It is also known as a NULL vector because in this type of vector initial point and the terminal point are the same. In order to do this, we can simply multiply both the and the component of the vector by the given scalar: 3 3 ( 1, 8) ( 3 ( 1), 3 ( 8)) ( 3, 2 4).Unit vector − A vector whose magnitude is unity which is 1 is known as the unit vector.There are multiple types of vectors like − The distance between the initial point and the terminal point of the vector is known as the magnitude of the vector. The point from where the vector starts is known as the initial point and the point where the vector ends is known as the terminal point. In mathematics, a quantity that has a magnitude and a direction is known as a vector whereas a quantity that has only one value as magnitude is known as a scalar. We are given two vectors let’s say vector A and vector B containing x, y, and directions, and the task is to find the cross product and dot product of the two given vector arrays.
0 Comments
Leave a Reply. |