Enter the components of the two vectors a and b. The formula below is linked to the input fields, so you can also calculate by editing the stacked numbers in it directly. For 2D vectors, leave the z-component fields blank (0).
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and figures
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter the components of two 3D vectors \(\vec{a}\) and \(\vec{b}\), and get the components of the cross product \(\vec{a}\times\vec{b}\), with each step of the criss-cross multiplication shown
- The magnitude \(|\vec{a}\times\vec{b}|\) (the area of the parallelogram formed by the two vectors) is shown both as an exact value with a square root, such as \(3\sqrt{6}\), and as a decimal. The area of the triangle (half of it) is calculated at the same time
- You also get the unit normal vector \(\vec{n}\), which is perpendicular to both \(\vec{a}\) and \(\vec{b}\), the angle \(\theta\) between the two vectors, and a check that the dot products are 0 (proof of perpendicularity)
- The result is also drawn as a 3D figure you can rotate with the mouse, so you can see how the cross product stands perpendicular to the parallelogram (right-hand rule)
- Components can be decimals, negative numbers or fractions such as 3/4. Leave the z-components blank (0) to use it for 2D vectors too
- A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
In the 3D images of games and movies, the surface of an object is split into many small triangles. The normal vector that shows which way each triangle faces is calculated as the cross product of two of its side vectors. How the light direction relates to this normal vector decides whether the surface looks bright or dark.
Curved surfaces look smoothly lit because the shading is calculated from these normal vectors, face by face.
The turning effect of a force is called torque (or moment of force). It is the cross product of the vector from the center of rotation to the point where you push and the vector of the force. Its magnitude, \(|\vec{r}||\vec{F}|\sin\theta\), matches everyday experience: "a longer wrench turns more easily" and "pushing at a right angle to the handle works best".
Mechanics use a torque wrench to tighten car bolts to a set value because this quantity is what they need to control.
An electric current in a magnetic field feels a force perpendicular to both the current and the field. The direction and size of this force are given by the cross product of the vector for the current and the vector for the magnetic field (for a single charge such as an electron, it is the cross product of its velocity and the field, \(\vec{F} = q\vec{v}\times\vec{B}\)). This perpendicular force is what turns a motor and moves the cone of a speaker.
The right-hand rule taught in high school physics is a way to find the direction of this cross product with your hand.
The area of a piece of land is calculated from the measured coordinates of its boundary points. Go around the polygon's vertices in order, compute \(x_1y_2 - x_2y_1\) for each pair of neighboring points, add them all up, and take half the absolute value of the total. You get the area without measuring each side. The key is to add the terms with their signs, without taking absolute values one by one. The extra parts then cancel out automatically, and even a dented (concave) lot gives the correct area. This uses the \(z\)-component of the cross product (the signed area) and is known as the shoelace formula, or the surveyor's area formula.
The same idea is used to compute the areas of lots in property surveys and in mapping (GIS) software.
To turn a drone or robot from "the direction it faces now" to "the direction it should face", you have to decide which axis to rotate around and by how many degrees. The cross product of the two direction vectors gives a vector perpendicular to both, which is the axis of rotation itself. The angle is found by combining the magnitude of the cross product (the \(\sin\theta\) part) and the dot product (the \(\cos\theta\) part).
The same idea is used for drone flight control and for turning a character's head or arm toward a target in 3D animation.
Formulas and figures
Symbols and terms
Symbols
| \(\vec{a}\) | vector a | A symbol for a quantity with a direction and a magnitude (length). The arrow over the letter marks it as a vector. In college textbooks and physics, vectors are often printed in bold (a) instead of with an arrow. |
| \(a_1,\ a_2,\ a_3\) | a sub 1, a sub 2, a sub 3 | The components of vector \(\vec{a}\): three numbers that tell how far it goes in the \(x\), \(y\) and \(z\) directions. The small number at the lower right (the subscript) tells which component it is. Some books write \(a_x,\ a_y,\ a_z\) instead. |
| \(\vec{a} \times \vec{b}\) | a cross b | The cross product (also called the vector product). It is named after the \(\times\) (cross) sign it uses. The answer is a vector, not a number. |
| \(\vec{a} \cdot \vec{b}\) | a dot b | The dot product (also called the scalar product). It is named after the dot it uses. Its answer is a number (a scalar). Its name and symbol look like those of the cross product, so keep the two apart. |
| \(\left| \vec{a} \right|\) | magnitude of a | The magnitude (length) of a vector, that is, the length of the arrow. From the components it is \(\sqrt{a_1^2 + a_2^2 + a_3^2}\), found with the Pythagorean theorem. It uses the same bars as absolute value, and both describe a distance from the origin. |
| \(\theta\) | theta | The angle between the two vectors. It is a Greek letter often used for angles. For the cross product, it is taken between 0° and 180°. |
| \(\sin\theta\) | sine theta | The sine of the angle \(\theta\). In a right triangle it is the ratio "opposite side ÷ hypotenuse", written \(\sin\) for short. Between 0° and 180° it is never negative: \(\sin 0^\circ = 0\), \(\sin 30^\circ = \dfrac{1}{2}\), \(\sin 90^\circ = 1\), \(\sin 180^\circ = 0\). |
| \(\overrightarrow{\mathrm{AB}}\) | vector AB | The vector that starts at point A and ends at point B. Its components are "coordinates of the end point − coordinates of the start point". To get a triangle area from three points, first make two side vectors in this form. |
| \(S\) | S | A letter often used for area, said to come from "surface" (\(A\) is also common in US books). On this page it stands for the area of the parallelogram. |
| \(S_{\triangle}\) | S triangle | The area of the triangle. A small triangle sign is added to \(S\) to tell it apart from the area of the parallelogram. |
| \(\vec{n}\) | vector n | The normal vector. By custom it uses \(n\), the first letter of "normal" (perpendicular). On this page it is the unit normal vector, scaled to length 1. |
| \(\vec{0}\) | zero vector | The vector whose components are all 0 (the zero vector). Its magnitude is 0 and it has no direction. When two vectors are parallel, their cross product is this zero vector. |
| \(\sqrt{\phantom{a}}\) | square root | The square root sign (radical). \(\sqrt{54}\) is "the positive number that gives 54 when squared". When a perfect square (\(4,\ 9,\ 16, \dots\)) hides under the root, move it outside to simplify, as in \(\sqrt{54} = \sqrt{9 \times 6} = 3\sqrt{6}\). |
Terms
| vector | A quantity with both a direction and a magnitude. Two arrows with the same direction and length count as the same vector, wherever they are drawn. Quantities that say "which way and how much", such as force, velocity and wind, are vectors. |
| component form | Writing a vector as a list of how far it goes in the \(x\), \(y\) and \(z\) directions, like \((1,\ 2,\ 3)\). It can also be written as a column (a column vector) with the same meaning. Some books use angle brackets, \(\langle 1,\ 2,\ 3 \rangle\), or \(\mathbf{i} + 2\mathbf{j} + 3\mathbf{k}\). |
| cross product | An operation that makes a new vector from two 3D vectors. It is also called the vector product. The new vector is perpendicular to both of the original vectors, and its magnitude equals the area of the parallelogram they form. |
| dot product | An operation that makes a number (a scalar) from two vectors. It equals \(|\vec{a}||\vec{b}|\cos\theta\), and when it is 0, the two vectors are perpendicular. It is different from the cross product, whose answer is a vector. |
| magnitude | The length of a vector. For components \((a_1,\ a_2,\ a_3)\) it is \(\sqrt{a_1^2 + a_2^2 + a_3^2}\), the Pythagorean theorem extended to space. It is also called the norm. |
| angle between vectors | The angle formed between two vectors when they are drawn from the same starting point. It is taken between 0° and 180°. |
| parallelogram | A four-sided shape whose two pairs of opposite sides are parallel. When two vectors are used as two of its sides, its area is the magnitude of the cross product. |
| normal vector | A vector perpendicular to a plane (or a line). It shows which way the surface faces, and the cross product makes one easily from two vectors lying in the plane. |
| unit vector | A vector of length 1. Dividing a vector by its own magnitude keeps its direction and makes its length 1, giving a unit vector. |
| unit normal vector | A normal vector scaled to length 1. It is used when you want only the direction. |
| criss-cross multiplication | A way of calculating with four numbers written in two rows - multiply along the two diagonals (down to the right and up to the right) and subtract. It is the 2×2 determinant pattern \(ad - bc\), and each component of the cross product has this form. |
| right-hand rule | The rule that gives the direction of the cross product. Curl the fingers of your right hand from \(\vec{a}\) toward \(\vec{b}\); your thumb points in the direction of \(\vec{a}\times\vec{b}\). A coordinate system that follows this rule is called right-handed. |
| zero vector | The vector whose components are all 0. Its magnitude is 0, and it has no direction. When two vectors are parallel, their cross product is the zero vector. |
| perpendicular | When the angle between two vectors is 90°. It is also called orthogonal. You can check it by seeing that the dot product is 0. |
| parallel | When two vectors point in the same direction or exactly opposite directions. They can then lie on the same line, so they cannot form a parallelogram (it collapses flat with area 0). |
| signed area | An area given a plus or minus sign depending on the direction of turning. In the plane, \(x_1y_2 - x_2y_1\) is a signed area: positive for counterclockwise and negative for clockwise. Its absolute value is the ordinary area. |
| determinant | A single number determined by numbers arranged in a square. The 2×2 determinant \(\begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc\) is exactly criss-cross multiplication, and each component of the cross product has the form of this 2×2 determinant. |
| cyclic order | An order that goes around in a loop and returns to the start, as in \(x \to y \to z \to x\). The three components of the cross product repeat the same form in this cyclic order. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the quickest way forward.
| What a vector is (Precalculus) |
|
| Coordinates in 3D space (Grade 6 to Precalculus) |
|
| The Pythagorean theorem and vector magnitude (Grade 8 to Precalculus) |
|
| Working with square roots (Grade 8 to Algebra 1) |
|
| The dot product (Precalculus) |
|
| Right triangle trigonometry (Geometry) |
|
| Area of parallelograms and triangles (Grade 6) |
|
How to calculate it in Excel
| x-component of a (a₁) | 1 |
| y-component of a (a₂) | 2 |
| z-component of a (a₃) | 3 |
| x-component of b (b₁) | 4 |
| y-component of b (b₂) | 5 |
| z-component of b (b₃) | 6 |
| x-component of a×b (a₂b₃ − a₃b₂) | =B2*B6-B3*B5 |
| y-component of a×b (a₃b₁ − a₁b₃) | =B3*B4-B1*B6 |
| z-component of a×b (a₁b₂ − a₂b₁) | =B1*B5-B2*B4 |
| x-component of a (a₁) | 1 |
| y-component of a (a₂) | 2 |
| z-component of a (a₃) | 3 |
| x-component of b (b₁) | 4 |
| y-component of b (b₂) | 5 |
| z-component of b (b₃) | 6 |
| Magnitude |a×b| (from components) | =SQRT((B2*B6-B3*B5)^2+(B3*B4-B1*B6)^2+(B1*B5-B2*B4)^2) |
| Magnitude of a |a| | =SQRT(B1^2+B2^2+B3^2) |
| Magnitude of b |b| | =SQRT(B4^2+B5^2+B6^2) |
| Dot product a·b | =B1*B4+B2*B5+B3*B6 |
| Angle θ (degrees) | =DEGREES(ACOS(B10/(B8*B9))) |
| |a||b|sinθ | =B8*B9*SIN(RADIANS(B11)) |
| x-component of a×b | -3 |
| y-component of a×b | 6 |
| z-component of a×b | -3 |
| Parallelogram area S (= magnitude) | =SQRT(B1^2+B2^2+B3^2) |
| Triangle area (half the parallelogram) | =B4/2 |
| x-component of a×b | -3 |
| y-component of a×b | 6 |
| z-component of a×b | -3 |
| Magnitude |a×b| | =SQRT(B1^2+B2^2+B3^2) |
| x-component of the unit normal | =B1/B4 |
| y-component of the unit normal | =B2/B4 |
| z-component of the unit normal | =B3/B4 |
| x-coordinate of A (x₁) | 4 |
| y-coordinate of A (y₁) | 1 |
| x-coordinate of B (x₂) | 1 |
| y-coordinate of B (y₂) | 3 |
| z-component of the cross product (x₁y₂ − x₂y₁) | =B1*B4-B3*B2 |
| Area of triangle OAB | =ABS(B5)/2 |
"*" is multiplication, "^" is a power, and SQRT is the square root function. The first table uses a = (1, 2, 3) and b = (4, 5, 6), and the answer is (−3, 6, −3).
The second table checks that "the magnitude found from the components" and "the value from |a||b|sinθ" match. B7 and B12 both come out as 7.348469… (the angle is about 12.93°).
In the third table, the parallelogram area is 7.348469… and the triangle area is half of that, 3.674234…. In the fourth table, the unit normal vector is (−0.408248…, 0.816497…, −0.408248…).
The fifth table is the case of 2D vectors with a z-component of 0. The area of the triangle with O(0, 0), A(4, 1) and B(1, 3) is 5.5.
How to calculate it in Google Sheets
| x-component of a (a₁) | 1 |
| y-component of a (a₂) | 2 |
| z-component of a (a₃) | 3 |
| x-component of b (b₁) | 4 |
| y-component of b (b₂) | 5 |
| z-component of b (b₃) | 6 |
| x-component of a×b (a₂b₃ − a₃b₂) | =B2*B6-B3*B5 |
| y-component of a×b (a₃b₁ − a₁b₃) | =B3*B4-B1*B6 |
| z-component of a×b (a₁b₂ − a₂b₁) | =B1*B5-B2*B4 |
| x-component of a (a₁) | 1 |
| y-component of a (a₂) | 2 |
| z-component of a (a₃) | 3 |
| x-component of b (b₁) | 4 |
| y-component of b (b₂) | 5 |
| z-component of b (b₃) | 6 |
| Magnitude |a×b| (from components) | =SQRT((B2*B6-B3*B5)^2+(B3*B4-B1*B6)^2+(B1*B5-B2*B4)^2) |
| Magnitude of a |a| | =SQRT(B1^2+B2^2+B3^2) |
| Magnitude of b |b| | =SQRT(B4^2+B5^2+B6^2) |
| Dot product a·b | =B1*B4+B2*B5+B3*B6 |
| Angle θ (degrees) | =DEGREES(ACOS(B10/(B8*B9))) |
| |a||b|sinθ | =B8*B9*SIN(RADIANS(B11)) |
| x-component of a×b | -3 |
| y-component of a×b | 6 |
| z-component of a×b | -3 |
| Parallelogram area S (= magnitude) | =SQRT(B1^2+B2^2+B3^2) |
| Triangle area (half the parallelogram) | =B4/2 |
| x-component of a×b | -3 |
| y-component of a×b | 6 |
| z-component of a×b | -3 |
| Magnitude |a×b| | =SQRT(B1^2+B2^2+B3^2) |
| x-component of the unit normal | =B1/B4 |
| y-component of the unit normal | =B2/B4 |
| z-component of the unit normal | =B3/B4 |
| x-coordinate of A (x₁) | 4 |
| y-coordinate of A (y₁) | 1 |
| x-coordinate of B (x₂) | 1 |
| y-coordinate of B (y₂) | 3 |
| z-component of the cross product (x₁y₂ − x₂y₁) | =B1*B4-B3*B2 |
| Area of triangle OAB | =ABS(B5)/2 |
How to calculate it in Python
from fractions import Fraction
import math
# Vector components (a fraction such as 3/4 can be written as Fraction(3, 4))
a = (Fraction(1), Fraction(2), Fraction(3))
b = (Fraction(4), Fraction(5), Fraction(6))
def cross(u, v):
# Cross product (criss-cross multiplication), built in the order x, y, z
return (u[1] * v[2] - u[2] * v[1],
u[2] * v[0] - u[0] * v[2],
u[0] * v[1] - u[1] * v[0])
def dot(u, v):
return u[0] * v[0] + u[1] * v[1] + u[2] * v[2]
c = cross(a, b)
area = math.sqrt(dot(c, c)) # parallelogram area (= magnitude of the cross product)
print(f"Cross product a×b = ({c[0]}, {c[1]}, {c[2]})")
print(f"Parallelogram area: {area}")
print(f"Triangle area: {area / 2}")
print(f"Perpendicular check (both are 0): {dot(a, c)}, {dot(b, c)}")
How to write it in LaTeX and other math languages (copy and paste)
a×b = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁)
\vec{a} \times \vec{b} = \begin{pmatrix} a_2 b_3 - a_3 b_2 \\ a_3 b_1 - a_1 b_3 \\ a_1 b_2 - a_2 b_1 \end{pmatrix}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mover><mi>a</mi><mo>→</mo></mover>
<mo>×</mo>
<mover><mi>b</mi><mo>→</mo></mover>
<mo>=</mo>
<mo>(</mo>
<mrow>
<msub><mi>a</mi><mn>2</mn></msub><msub><mi>b</mi><mn>3</mn></msub>
<mo>−</mo>
<msub><mi>a</mi><mn>3</mn></msub><msub><mi>b</mi><mn>2</mn></msub>
</mrow>
<mo>,</mo>
<mrow>
<msub><mi>a</mi><mn>3</mn></msub><msub><mi>b</mi><mn>1</mn></msub>
<mo>−</mo>
<msub><mi>a</mi><mn>1</mn></msub><msub><mi>b</mi><mn>3</mn></msub>
</mrow>
<mo>,</mo>
<mrow>
<msub><mi>a</mi><mn>1</mn></msub><msub><mi>b</mi><mn>2</mn></msub>
<mo>−</mo>
<msub><mi>a</mi><mn>2</mn></msub><msub><mi>b</mi><mn>1</mn></msub>
</mrow>
<mo>)</mo>
</mrow>
</math>
vec a xx vec b = (a_2 b_3 - a_3 b_2, a_3 b_1 - a_1 b_3, a_1 b_2 - a_2 b_1)
Cross[{a1, a2, a3}, {b1, b2, b3}]
LinearAlgebra:-CrossProduct(Vector([a1, a2, a3]), Vector([b1, b2, b3]));
c = cross(a, b);
a⃗×b⃗ = (a_2 b_3 − a_3 b_2, a_3 b_1 − a_1 b_3, a_1 b_2 − a_2 b_1)
|a×b| = |a||b|sinθ
\left| \vec{a} \times \vec{b} \right| = \left| \vec{a} \right| \left| \vec{b} \right| \sin\theta
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mo>|</mo>
<mover><mi>a</mi><mo>→</mo></mover>
<mo>×</mo>
<mover><mi>b</mi><mo>→</mo></mover>
<mo>|</mo>
<mo>=</mo>
<mo>|</mo><mover><mi>a</mi><mo>→</mo></mover><mo>|</mo>
<mo>|</mo><mover><mi>b</mi><mo>→</mo></mover><mo>|</mo>
<mi>sin</mi><mo>⁡</mo><mi>θ</mi>
</mrow>
</math>
|vec a xx vec b| = |vec a| |vec b| sin theta
Norm[Cross[a, b]] == Norm[a] Norm[b] Sin[theta]
LinearAlgebra:-Norm(LinearAlgebra:-CrossProduct(a, b), 2);
m = norm(cross(a, b));
|a⃗×b⃗| = |a⃗||b⃗| sinθ
S = |a×b|, S△ = |a×b| ÷ 2
S = \left| \vec{a} \times \vec{b} \right|,\quad S_{\triangle} = \frac{1}{2} \left| \vec{a} \times \vec{b} \right|
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>S</mi>
<mo>=</mo>
<mo>|</mo>
<mover><mi>a</mi><mo>→</mo></mover>
<mo>×</mo>
<mover><mi>b</mi><mo>→</mo></mover>
<mo>|</mo>
<mo>,</mo>
<msub><mi>S</mi><mo>△</mo></msub>
<mo>=</mo>
<mfrac><mn>1</mn><mn>2</mn></mfrac>
<mo>|</mo>
<mover><mi>a</mi><mo>→</mo></mover>
<mo>×</mo>
<mover><mi>b</mi><mo>→</mo></mover>
<mo>|</mo>
</mrow>
</math>
S = |vec a xx vec b|, S_triangle = 1/2 |vec a xx vec b|
area = Norm[Cross[a, b]]; triangle = area/2
S := LinearAlgebra:-Norm(LinearAlgebra:-CrossProduct(a, b), 2);
S = norm(cross(a, b)); tri = S / 2;
S = |a⃗×b⃗|, S_△ = 1/2 |a⃗×b⃗|
n = (a×b) ÷ |a×b|
\vec{n} = \frac{\vec{a} \times \vec{b}}{\left| \vec{a} \times \vec{b} \right|}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mover><mi>n</mi><mo>→</mo></mover>
<mo>=</mo>
<mfrac>
<mrow>
<mover><mi>a</mi><mo>→</mo></mover>
<mo>×</mo>
<mover><mi>b</mi><mo>→</mo></mover>
</mrow>
<mrow>
<mo>|</mo>
<mover><mi>a</mi><mo>→</mo></mover>
<mo>×</mo>
<mover><mi>b</mi><mo>→</mo></mover>
<mo>|</mo>
</mrow>
</mfrac>
</mrow>
</math>
vec n = (vec a xx vec b) / |vec a xx vec b|
n = Normalize[Cross[a, b]]
n := LinearAlgebra:-Normalize(LinearAlgebra:-CrossProduct(a, b), 2);
n = cross(a, b) / norm(cross(a, b));
n⃗ = (a⃗×b⃗)/|a⃗×b⃗|
S△ = |x₁y₂ − x₂y₁| ÷ 2
S_{\triangle} = \frac{1}{2} \left| x_1 y_2 - x_2 y_1 \right|
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msub><mi>S</mi><mo>△</mo></msub>
<mo>=</mo>
<mfrac><mn>1</mn><mn>2</mn></mfrac>
<mo>|</mo>
<msub><mi>x</mi><mn>1</mn></msub><msub><mi>y</mi><mn>2</mn></msub>
<mo>−</mo>
<msub><mi>x</mi><mn>2</mn></msub><msub><mi>y</mi><mn>1</mn></msub>
<mo>|</mo>
</mrow>
</math>
S_triangle = 1/2 |x_1 y_2 - x_2 y_1|
Abs[x1*y2 - x2*y1]/2
S := abs(x1*y2 - x2*y1)/2;
S = abs(x1*y2 - x2*y1) / 2;
S_△ = 1/2 |x_1 y_2 − x_2 y_1|
How to have ChatGPT do the calculation
You are a calculation assistant for vectors (3D geometry). Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). For the vectors a = (1, 2, 3) and b = (4, 5, 6), find the following. 1. The components of the cross product a×b (also show the criss-cross multiplication steps) 2. The magnitude |a×b| (both as an exact value with the radical simplified and as a decimal) 3. The areas of the parallelogram and the triangle formed by a and b 4. The values of a·(a×b) and b·(a×b), to check that the cross product is perpendicular to both In Python, compute the components exactly with the fractions module from the standard library; you may use sympy to simplify the radical. Show the formulas you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
