homechevron_rightStudychevron_rightMathchevron_rightGeometry

Cross product calculator

This online calculator computes the cross product (or vector product) and visualizes the result in a cartesian coordinate system.

Creative Commons Attribution/Share-Alike License 3.0 (Unported)

This content is licensed under Creative Commons Attribution/Share-Alike License 3.0 (Unported). That means you may freely redistribute or modify this content under the same license conditions and must attribute the original author by placing a hyperlink from your site to this work https://planetcalc.com/8315/. Also, please do not modify any references to the original work (if any) contained in this content.

The calculator below computes the cross product of two vectors in three-dimensional space and visualizes the result. On the graph, first vector is shown in green, second vector is shown in blue, and cross product is shown is red. The theory and formulas can be found below the calculator.

PLANETCALC, Cross product calculator

Cross product calculator

Vector a

Vector b

Digits after the decimal point: 2
x
 
y
 
z
 

Cross product

Definition1

The cross product or vector product (occasionally directed area product to emphasize the geometric significance) is a binary operation on two vectors in three-dimensional space \left(\mathbb {R} ^{3}\right) and is denoted by the symbol \times. Given two linearly independent vectors \mathbf {a} and \mathbf {b}, the cross product, \mathbf {a} \times \mathbf {b} (read "a cross b"), is a vector that is perpendicular to both \mathbf {a} and \mathbf {b} and thus normal to the plane containing them.

The cross product is defined by the formula:

\mathbf {a} \times \mathbf {b} =\left\|\mathbf {a} \right\|\left\|\mathbf {b} \right\|\sin(\theta )\ \mathbf {n},

where θ is the angle between a and b in the plane containing them (hence, it is between 0° and 180°), ‖a‖ and ‖b‖ are the magnitudes of vectors a and b, and n is a unit vector perpendicular to the plane containing a and b in the direction given by the right-hand rule. If the vectors a and b are parallel (i.e., the angle θ between them is either 0° or 180°), by the above formula, the cross product of a and b is the zero vector 0.

By convention, the direction of the vector n is given by the right-hand rule, where one simply points the forefinger of the right hand in the direction of a and the middle finger in the direction of b. Then, the vector n is coming out of the thumb (see the adjacent picture). Using this rule implies that the cross product is anti-commutative, i.e., b × a = −(a × b). By pointing the forefinger toward b first, and then pointing the middle finger toward a, the thumb will be forced in the opposite direction, reversing the sign of the product vector.

Using the cross product requires the handedness of the coordinate system to be taken into account. The right-hand rule above is for a right-handed coordinate system. In a left-handed coordinate system, the direction of the vector n is given by the left-hand rule and points in the opposite direction.

Formula

We need some practical way to compute cross product from the coordinates of two vectors. For the standard basis for three-dimensional space, formed by vectors

i=(1,0,0),\quad j=(0,1,0),\quad k=(0,0,1),

we can write the following equalities from the definition of the cross product.

i \times j = k \\ j \times k = i \\ k \times i = j \\ j \times i = -k \\ k \times j = -i \\ i \times k = -j \\ i \times i = j \times j = k \times k = 0

Since each vector can be defined as linear combination of three basis vectors, we can write vectors
a=(x_1,y_1,z_1),\quad b=(x_2,y_2,z_2)
as
a=x_1i + y_1j+z_1k,\quad b=x_2i+y_2j+z_2k.

Thus, the cross product of a and b will be
a \times b=(x_1i + y_1j+z_1k) \times (x_2i+y_2j+z_2k).

This can be expanded using distributivity
a \times b=x_1x_2(i \times i)+x_1y_2(i \times j)+x_1z_2(i \times k)+y_1x_2(j \times i)+y_1y_2(j \times j)+y_1z_2(j \times k)+z_1x_2(k \times i)+z_1y_2(k \times j)+z_1z_2(k \times k)

Which can be simplified using standard basis equalities above down to
a \times b=(y_1z_2-z_1y_2)i+(z_1x_2-x_1z_2)j+(x_1y_2-y_1x_2)k

BTW, the expression above can be written as determinant
a\times b ={\begin{vmatrix}i &j &k \\x_{1}&y_{1}&z_{1}\\x_{2}&y_{2}&z_{2}\\\end{vmatrix}}

The last formula describes a resulting cross product vector with coordinates:
a \times b={\begin{pmatrix}y_1z_2-z_1y_2\\z_1x_2-x_1z_2\\x_1y_2-y_1x_2\end{pmatrix}}

Creative Commons Attribution/Share-Alike License 3.0 (Unported) PLANETCALC, Cross product calculator

Comments