Google News
logo
Unity - Interview Questions
What is Dot product and Cross product?
In mathematics, the dot product and cross product are both operations used in vector algebra and vector calculus.

The dot product of two vectors is a scalar value that results from multiplying the magnitudes of the two vectors and the cosine of the angle between them. It is also called the scalar product or inner product. The dot product is defined as :

a · b = |a| |b| cos(θ)

where a and b are vectors, |a| and |b| are their magnitudes, and θ is the angle between them.

The cross product of two vectors is a vector that is perpendicular to both of the input vectors. It is also called the vector product or outer product. The cross product is defined as :

a x b = |a| |b| sin(θ) n

where a and b are vectors, |a| and |b| are their magnitudes, θ is the angle between them, and n is the unit vector perpendicular to both a and b according to the right-hand rule.
Advertisement