Vector Calculator
Cross product, dot product, magnitude, unit vector & angle between vectors
A vector calculator takes two vectors and returns their dot product, cross product, magnitudes, unit vectors and the angle between them. For a = ⟨3, −2, 5⟩ and b = ⟨1, 4, −2⟩ the dot product is −15, the cross product is ⟨−16, 11, 14⟩ and the angle between them is about 122.07°. Enter your own 2D or 3D components below and every step is shown.
Last updated October 2026
Method: Standard component formulas of vector algebra. The dot product is a₁b₁ + a₂b₂ + a₃b₃, the magnitude is √(a · a), the angle is arccos((a · b) / (|a| |b|)), and the cross product is the 3 × 3 determinant expanded along the i, j, k row. Arithmetic on your inputs uses exact fractions; only square roots and angles are rounded.
Included: Sum, difference, scalar multiple, magnitude, unit vector, dot product, cross product with the determinant expansion, angle in degrees and radians, vector and scalar projection, triple scalar product, parallelogram and triangle area, and an exact parallel and orthogonal check for 2D and 3D vectors.
Not included: Vectors with four or more components, symbolic entries such as ⟨x, 1, 2⟩, complex components, and vector calculus (gradient, divergence, curl).
➡️ Enter your vectors
Vector c is only used for the triple scalar product a · (b × c).
Components accept whole numbers, decimals and fractions such as 3/4 or -1/2. Results stay exact where the math allows it; square roots and angles are rounded.
➡️ Cross product a × b
📋 Step-by-step
= i[(−2)(−2) − (5)(4)] − j[(3)(−2) − (5)(1)] + k[(3)(4) − (−2)(1)]
= i(4 − 20) − j(−6 − 5) + k(12 − (−2))
= i(−16) − j(−11) + k(14)
= −16i + 11j + 14k = ⟨−16, 11, 14⟩
Check: (a × b) · a = 0 and (a × b) · b = 0, so a × b is perpendicular to both vectors.
|a × b| = √((−16)² + 11² + 14²) = √(256 + 121 + 196) = √573 ≈ 23.9374
That length is the area of the parallelogram spanned by a and b; the triangle with sides a and b has half of it, 11.9687.
📐 Parallel or orthogonal?
Orthogonal means a · b = 0. Parallel means a × b is the zero vector (in 2D: a₁b₂ − a₂b₁ = 0). Both tests are exact here because the arithmetic uses fractions, not rounded decimals.
🧮 All results at a glance
| Quantity | Value |
|---|---|
| a + b | ⟨4, 2, 3⟩ |
| a − b | ⟨2, −6, 7⟩ |
| k a (k = 2) | ⟨6, −4, 10⟩ |
| |a| | √38 ≈ 6.1644 |
| |b| | √21 ≈ 4.5826 |
| Unit vector â | ⟨0.4867, −0.3244, 0.8111⟩ |
| Unit vector b̂ | ⟨0.2182, 0.8729, −0.4364⟩ |
| Dot product a · b | −15 |
| Cross product a × b | ⟨−16, 11, 14⟩ |
| |a × b| (parallelogram area) | √573 ≈ 23.9374 |
| Triangle area |a × b| / 2 | 11.9687 |
| Angle θ | 122.0727° = 2.1306 rad |
| Projection of a onto b | ⟨−5/7, −20/7, 10/7⟩ ≈ ⟨−0.7143, −2.8571, 1.4286⟩ |
| Scalar projection of a onto b | −3.2733 |
| Triple product a · (b × c) | −18 |
Vector calculator: dot product, cross product, magnitude and angle explained
A vector has both a size and a direction, and almost every question you can ask about two vectors comes down to a handful of formulas. This calculator applies all of them to the vectors you enter, in two or three dimensions, and writes out the arithmetic for whichever operation you pick. Whole numbers, decimals and fractions stay exact through every sum and product, so a projection such as (−5/7) · ⟨1, 4, −2⟩ appears as ⟨−5/7, −20/7, 10/7⟩ instead of a rounded approximation.
If your vectors come out of a set of equations rather than out of geometry, the System of Equations Calculator and the Matrix Calculator cover that side of linear algebra. For the straight-line distance between two points, the Distance Calculator is quicker.
What each vector operation tells you
The operations answer different questions. Addition and subtraction combine displacements: moving by ⟨3, −2, 5⟩ and then by ⟨1, 4, −2⟩ leaves you at ⟨4, 2, 3⟩. A scalar multiple stretches or shrinks a vector, and it reverses the direction when the scalar is negative. The magnitude is the vector's length, and the unit vector keeps the direction while scaling the length to exactly 1.
The two products raise most of the questions. The dot product is a single number that measures how strongly two vectors point the same way, which is why it leads straight to the angle between them. The cross product is a new vector at right angles to both inputs, and its length equals the area of the parallelogram they span. The projection splits one vector into a part along another vector and a part perpendicular to it, and the triple scalar product of three vectors gives the volume of the slanted box they form.
The vector formulas
With a = ⟨a₁, a₂, a₃⟩, b = ⟨b₁, b₂, b₃⟩ and c = ⟨c₁, c₂, c₃⟩, these are the definitions the calculator uses:
a + b = ⟨a₁ + b₁, a₂ + b₂, a₃ + b₃⟩ a · b = a₁b₁ + a₂b₂ + a₃b₃ |a| = √(a₁² + a₂² + a₃²) â = a / |a| cos θ = (a · b) / (|a| |b|) a × b = ⟨a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁⟩ proj_b a = ((a · b) / |b|²) b a · (b × c) = det[a; b; c] For 2D vectors, drop every third component. The cross product then treats both vectors as having a z component of 0, which leaves only the last entry, a₁b₂ − a₂b₁. Two identities tie the products together and make excellent checks: |a × b| = |a| |b| sin θ, and Lagrange's identity, |a × b|² = |a|²|b|² − (a · b)².
Worked example 1: dot product and angle between two 3D vectors
Take a = ⟨3, −2, 5⟩ and b = ⟨1, 4, −2⟩, the default vectors in the calculator. Multiply matching components and add:
a · b = (3)(1) + (−2)(4) + (5)(−2) = 3 − 8 − 10 = −15 The negative sign already tells you the angle is wider than 90°. To pin it down you need both lengths:
|a| = √(9 + 4 + 25) = √38 ≈ 6.1644 |b| = √(1 + 16 + 4) = √21 ≈ 4.5826 cos θ = −15 / (√38 · √21) = −15/√798 ≈ −0.5310 θ = arccos(−0.5310) ≈ 122.0727° = 2.1306 rad Keep the square roots exact until the final step. If you round the lengths to 6.16 and 4.58 first, the cosine becomes −0.5317 and the angle comes out as 122.1186°, about 0.05° off. Rounding them to 6.2 and 4.6 gives 121.7320°, a third of a degree away, which is enough to miss an answer key that expects four decimals.
Worked example 2: the cross product by determinant expansion
For the same two vectors, put the unit vectors i, j and k in the top row of a determinant, a in the middle row and b in the bottom row, then expand along the top row. The middle term carries a minus sign, which is the step most often lost by hand:
a × b = i[(−2)(−2) − (5)(4)] − j[(3)(−2) − (5)(1)] + k[(3)(4) − (−2)(1)] = i(4 − 20) − j(−6 − 5) + k(12 − (−2)) = −16i + 11j + 14k = ⟨−16, 11, 14⟩ Two quick checks confirm the result. First, the cross product must be perpendicular to both inputs: ⟨−16, 11, 14⟩ · ⟨3, −2, 5⟩ = −48 − 22 + 70 = 0, and ⟨−16, 11, 14⟩ · ⟨1, 4, −2⟩ = −16 + 44 − 28 = 0. Second, Lagrange's identity says the squared length must be 38 × 21 − (−15)² = 798 − 225 = 573. The components give 256 + 121 + 196 = 573, so |a × b| = √573 ≈ 23.9374. That is the area of the parallelogram spanned by a and b; the triangle with the same two sides has half of it, about 11.9687.
Add a third vector c = ⟨2, 0, 1⟩ and the triple scalar product a · (b × c) is the 3 × 3 determinant with rows a, b and c: 3(4 − 0) − (−2)(1 + 4) + 5(0 − 8) = 12 + 10 − 40 = −18. The box with edges a, b and c therefore has a volume of 18, the tetrahedron on the same edges has a volume of 3, and the negative sign means the three vectors form a left-handed set.
Worked example 3: unit vector, angle and projection in 2D
Switch to 2D and enter a = ⟨7, 1⟩ and b = ⟨3, 4⟩, or tap the 2D preset. The lengths are |a| = √50 = 5√2 ≈ 7.0711 and |b| = √25 = 5, so the unit vector of b is exact: b̂ = ⟨3/5, 4/5⟩ = ⟨0.6, 0.8⟩. The dot product is 21 + 4 = 25, which gives a clean angle:
cos θ = 25 / (5√2 · 5) = 1/√2 ≈ 0.7071 θ = 45° exactly = π/4 rad The projection of a onto b is (25/25) · ⟨3, 4⟩ = ⟨3, 4⟩, so the shadow of a on b happens to be b itself, with a scalar projection of 25/5 = 5. Subtracting it leaves the perpendicular part ⟨4, −3⟩, and ⟨4, −3⟩ · ⟨3, 4⟩ = 0 confirms the split. Treating both vectors as 3D vectors with z = 0 gives a × b = ⟨0, 0, 25⟩: the parallelogram has an area of 25, and the positive sign means b lies counterclockwise from a. The calculator also reports the direction of each 2D vector measured from the positive x-axis, 8.1301° for a and 53.1301° for b, and their difference is the same 45°.
Reference table: 3D vectors with whole-number length
Most vectors have irrational lengths, which is why textbooks lean on a small family whose components form Pythagorean quadruples. Their unit vectors are exact fractions, and those fractions are also the direction cosines, the cosines of the angles α, β and γ that the vector makes with the x-, y- and z-axes. Every value below was computed with the same code the calculator runs.
| Vector | Length | Unit vector (exact) | Unit vector (decimal) | α / β / γ |
|---|---|---|---|---|
| ⟨1, 2, 2⟩ | 3 | ⟨1/3, 2/3, 2/3⟩ | ⟨0.3333, 0.6667, 0.6667⟩ | 70.53° / 48.19° / 48.19° |
| ⟨2, 3, 6⟩ | 7 | ⟨2/7, 3/7, 6/7⟩ | ⟨0.2857, 0.4286, 0.8571⟩ | 73.40° / 64.62° / 31.00° |
| ⟨1, 4, 8⟩ | 9 | ⟨1/9, 4/9, 8/9⟩ | ⟨0.1111, 0.4444, 0.8889⟩ | 83.62° / 63.61° / 27.27° |
| ⟨4, 4, 7⟩ | 9 | ⟨4/9, 4/9, 7/9⟩ | ⟨0.4444, 0.4444, 0.7778⟩ | 63.61° / 63.61° / 38.94° |
| ⟨2, 6, 9⟩ | 11 | ⟨2/11, 6/11, 9/11⟩ | ⟨0.1818, 0.5455, 0.8182⟩ | 79.52° / 56.94° / 35.10° |
| ⟨6, 6, 7⟩ | 11 | ⟨6/11, 6/11, 7/11⟩ | ⟨0.5455, 0.5455, 0.6364⟩ | 56.94° / 56.94° / 50.48° |
| ⟨3, 4, 12⟩ | 13 | ⟨3/13, 4/13, 12/13⟩ | ⟨0.2308, 0.3077, 0.9231⟩ | 76.66° / 72.08° / 22.62° |
| ⟨2, 5, 14⟩ | 15 | ⟨2/15, 1/3, 14/15⟩ | ⟨0.1333, 0.3333, 0.9333⟩ | 82.34° / 70.53° / 21.04° |
| ⟨2, 10, 11⟩ | 15 | ⟨2/15, 2/3, 11/15⟩ | ⟨0.1333, 0.6667, 0.7333⟩ | 82.34° / 48.19° / 42.83° |
| ⟨8, 9, 12⟩ | 17 | ⟨8/17, 9/17, 12/17⟩ | ⟨0.4706, 0.5294, 0.7059⟩ | 61.93° / 58.03° / 45.10° |
Two patterns are worth noticing. Scaling a vector never changes its unit vector, so ⟨2, 4, 4⟩ shares the unit vector ⟨1/3, 2/3, 2/3⟩ with ⟨1, 2, 2⟩. And the squares of the three direction cosines always add up to 1: for ⟨2, 3, 6⟩, (2/7)² + (3/7)² + (6/7)² = 4/49 + 9/49 + 36/49 = 1.
Dot product, cross product and angle for common vector pairs
The table pairs vectors that come up again and again in homework and geometry. Angles are rounded to four decimals; the exact ones are marked.
| a | b | a · b | a × b | Angle θ |
|---|---|---|---|---|
| ⟨1, 1, 0⟩ | ⟨0, 1, 1⟩ | 1 | ⟨1, −1, 1⟩ | 60° (exact) |
| ⟨1, 0, 0⟩ | ⟨1, 1, 1⟩ | 1 | ⟨0, −1, 1⟩ | 54.7356° |
| ⟨1, 1, 0⟩ | ⟨1, 1, 1⟩ | 2 | ⟨1, −1, 0⟩ | 35.2644° |
| ⟨1, 2, 2⟩ | ⟨2, 3, 6⟩ | 20 | ⟨6, −2, −1⟩ | 17.7528° |
| ⟨3, −2, 5⟩ | ⟨1, 4, −2⟩ | −15 | ⟨−16, 11, 14⟩ | 122.0727° |
| ⟨2, −1, 4⟩ | ⟨3, 2, −1⟩ | 0 | ⟨−7, 14, 7⟩ | 90° (exact) |
| ⟨1, −2, 3⟩ | ⟨−2, 4, −6⟩ | −28 | ⟨0, 0, 0⟩ | 180° (exact) |
| ⟨7, 1⟩ | ⟨3, 4⟩ | 25 | ⟨0, 0, 25⟩ | 45° (exact) |
| ⟨3, 4⟩ | ⟨−4, 3⟩ | 0 | ⟨0, 0, 25⟩ | 90° (exact) |
The cube rows are a classic: the angle between an edge of a cube and its space diagonal is arccos(1/√3) ≈ 54.7356°, and the angle between a face diagonal and the space diagonal is arccos(2/√6) ≈ 35.2644°. The opposite pair shows a zero cross product at 180°, and both orthogonal pairs show a zero dot product at 90°.
How to use this calculator
Choose 2D or 3D, then type the components of a and b. Each box accepts whole numbers, decimals and fractions such as 3/4 or −1/2. The scalar k feeds the scalar multiple, and vector c, which appears only in 3D mode, feeds the triple scalar product. The Swap button exchanges a and b, which makes it easy to compare a × b with b × a, or the projection of a onto b with the projection of b onto a.
Pick an operation to see its result in the blue card and its full working in the step-by-step card below. The parallel or orthogonal card runs both tests, and the table at the bottom lists every quantity at once. The decimal places buttons control rounding only; exact fractions and radicals such as √38 are never rounded. A decimal too small for the chosen number of places, or 10¹⁵ and above, is shown in e-notation, such as 1.414e−10, rather than as 0 or a long row of digits.
Who uses vector operations
Students meet these operations in precalculus, multivariable calculus, linear algebra and physics, usually as homework that asks for a cross product or an angle with every step written out. Physics and engineering rely on them constantly. The work done by a force is the dot product W = F · d, so a force of ⟨20, 15, 0⟩ newtons that moves an object by ⟨30, 10, 0⟩ meters does 600 + 150 = 750 joules of work. Torque is the cross product τ = r × F, so a 40-newton push along the y-axis applied 0.3 meters out along the x-axis gives ⟨0, 0, 12⟩ newton meters about the z-axis.
Computer graphics programmers use the cross product to build surface normals and the dot product to shade a surface by the angle between its normal and the light. Game and mapping software uses the sign of the 2D cross product to decide which side of a line a point lies on. The cross product also measures triangles in space: for the points P(1, 0, 2), Q(4, 2, 3) and R(2, 5, 1), the edge vectors PQ = ⟨3, 2, 1⟩ and PR = ⟨1, 5, −1⟩ have cross product ⟨−7, 4, 13⟩ with length √234 ≈ 15.2971, so the triangle's area is about 7.6485.
Key terms
- Vector: a quantity with magnitude and direction, written in components such as ⟨3, −2, 5⟩.
- Scalar: an ordinary number. The dot product and the triple product return scalars.
- Magnitude (norm, length): |a| = √(a · a), never negative.
- Unit vector: a vector of length 1; â = a / |a| points the same way as a.
- Dot product (scalar or inner product): a · b = a₁b₁ + a₂b₂ + a₃b₃.
- Cross product (vector product): a × b, perpendicular to a and b, with length |a| |b| sin θ.
- Orthogonal: perpendicular; the dot product is 0.
- Parallel: one vector is a scalar multiple of the other; the cross product is the zero vector.
- Projection: the part of a that lies along b, as a vector (proj_b a) or as a signed length (the scalar projection).
- Right-hand rule: curl the fingers of your right hand from a toward b and your thumb points along a × b.
- Triple scalar product: a · (b × c), the signed volume of the box with edges a, b and c.
What changes the result, and how to check it
- Order in the cross product. b × a = −(a × b), so swapping the vectors flips every component: for the worked example, b × a = ⟨16, −11, −14⟩. The dot product and the angle do not depend on order.
- Direction of a projection. The projection of a onto b and the projection of b onto a are different vectors. In the 2D example they are ⟨3, 4⟩ and ⟨7/2, 1/2⟩.
- Dimension. A 2D vector is the same as a 3D vector with z = 0. A stray value in the z box changes the magnitude, the angle and the cross product.
- Angle units. Most software returns arccos in radians. The values 2.1306 rad and 122.0727° describe the same angle; multiply radians by 180/π to convert.
- Zero vectors. A zero vector has no direction, so its unit vector, its angle with another vector and any projection onto it are undefined.
Three checks catch most hand-calculation errors. The cross product must have a dot product of 0 with both inputs. Its squared length must equal |a|²|b|² − (a · b)². And the angle must agree with the signs: a positive dot product means an acute angle, a negative one an obtuse angle.
Limitations
The calculator handles vectors with two or three numeric components. It does not accept variables, so it cannot simplify the cross product of symbolic vectors, and it does not work with complex components or with four or more dimensions, where the familiar cross product is not defined. Square roots, angles, unit vectors and scalar projections are displayed as decimals rounded to the precision you choose, so read a displayed 0.7071 as √2/2 rather than as an exact value. Large inputs are still computed exactly, but a square root is only simplified into radical form while the number under it stays below about 10¹⁵; beyond that you get the decimal value alone.
Related calculators
- To solve two, three or four linear equations at once, use the System of Equations Calculator.
- For determinants, inverses and matrix products, use the Matrix Calculator.
- To row-reduce a matrix with every row operation shown, use the RREF Calculator.
- To solve a single equation for x with steps, use the Algebra Calculator or, for ax + b = c, the Linear Equation Calculator.
- For the straight-line distance between two points, use the Distance Calculator.
- For sine, cosine and angle conversions, use the Trigonometry Calculator.
Sources
Vector algebra is deterministic mathematics, so every figure on this page follows from the definitions rather than from published data. The definitions and identities used here match these references:
- NIST Digital Library of Mathematical Functions, §1.6 Vectors and Vector-Valued Functions: the dot product (1.6.2), the norm (1.6.3), the angle between vectors (1.6.4), the cross product as a determinant (1.6.9) and the parallelepiped volume |a · (b × c)|.
- MIT OpenCourseWare 18.02SC Multivariable Calculus, Notes: Cross Product: the determinant definition, |A × B| = |A||B| sin θ as the parallelogram area, the right-hand rule, Lagrange's identity and the triangle-area method.
- MIT OpenCourseWare 18.02SC, Session 2: Dot Products: the component formula and its link to lengths and angles.
- NIST Special Publication 811, Guide for the Use of the International System of Units: the radian as the SI unit of plane angle and the degree as π/180 rad.
- All worked examples and table values were computed with the calculator's own exact-fraction code and cross-checked in floating point.
⚠️ Common mistakes & edge cases
Reversing the order of a cross product
The cross product is anticommutative: b × a = −(a × b). For the worked example, a × b = ⟨−16, 11, 14⟩ while b × a = ⟨16, −11, −14⟩. Both are perpendicular to a and b, but only one follows the right-hand rule for the order your problem states.
Dropping the minus sign on the j term
The determinant expands as i(...) − j(...) + k(...). Forget the minus and the example turns into ⟨−16, −11, 14⟩, which fails the perpendicularity check at once: its dot product with a is −48 + 22 + 70 = 44, not 0.
Reading radians as degrees
A calculator in radian mode returns arccos(−0.5310) = 2.1306, the same angle as 122.0727°. Reporting 2.1306 as degrees, or 122.07 as radians, is a frequent and costly slip. This calculator always shows both units side by side.
Rounding the lengths too early
Dividing by lengths rounded to one decimal moved the example angle from 122.0727° to 121.7320°. Keep |a| and |b| as exact radicals until the final inverse cosine, as the calculator does.
Expecting a vector from the dot product
The dot product is a scalar and the cross product is a vector. Writing a · b = ⟨3, −8, −10⟩ (the products before adding them) or treating the 2D cross product as a 2D vector are both category errors. In 2D the cross product is just the number a₁b₂ − a₂b₁.
Projecting onto the wrong vector
proj_b a divides by |b|² and points along b; proj_a b divides by |a|² and points along a. For ⟨7, 1⟩ and ⟨3, 4⟩ the two answers are ⟨3, 4⟩ and ⟨7/2, 1/2⟩. Check which vector the problem projects onto before you start.
❓ Frequently asked questions
How do I calculate the cross product of two vectors?
Write a determinant with i, j and k in the top row, the components of a in the second row and the components of b in the third, then expand along the top row: a × b = (a₂b₃ − a₃b₂)i − (a₁b₃ − a₃b₁)j + (a₁b₂ − a₂b₁)k. For a = ⟨3, −2, 5⟩ and b = ⟨1, 4, −2⟩ that is i(4 − 20) − j(−6 − 5) + k(12 − (−2)) = ⟨−16, 11, 14⟩. The result is perpendicular to both of the original vectors.
How do I find the dot product of two vectors?
Multiply matching components and add the products: a · b = a₁b₁ + a₂b₂ + a₃b₃. For ⟨3, −2, 5⟩ and ⟨1, 4, −2⟩ the three products are 3, −8 and −10, so the dot product is −15. The answer is a single number, not a vector. A positive dot product means the angle between the vectors is less than 90°, zero means they are perpendicular, and a negative value such as −15 means the angle is greater than 90°.
How do I find the angle between two vectors?
Divide the dot product by the product of the two lengths and take the inverse cosine: θ = arccos((a · b) / (|a| |b|)). For a = ⟨3, −2, 5⟩ and b = ⟨1, 4, −2⟩, a · b = −15, |a| = √38 and |b| = √21, so cos θ = −15/√798 ≈ −0.5310 and θ ≈ 122.0727°, which is 2.1306 radians. The angle between two vectors always lies between 0° and 180°.
How do I calculate the magnitude of a vector?
Square each component, add the squares and take the square root: |a| = √(a₁² + a₂² + a₃²). The vector ⟨3, −2, 5⟩ has magnitude √(9 + 4 + 25) = √38 ≈ 6.1644, and the 2D vector ⟨6, −8⟩ has magnitude √100 = 10. It is the Pythagorean theorem applied to the components, so the magnitude is never negative and is zero only for the zero vector.
How do I find the unit vector in the direction of a vector?
Divide every component by the vector's magnitude: â = a / |a|. The vector ⟨2, −1, 2⟩ has length 3, so its unit vector is ⟨2/3, −1/3, 2/3⟩. For ⟨3, 4⟩ the length is 5 and the unit vector is ⟨0.6, 0.8⟩. The zero vector has no unit vector, because it has no direction and dividing by a length of 0 is undefined.
What is the difference between the dot product and the cross product?
The dot product returns a scalar that measures how much two vectors point the same way: it is largest when they are parallel and zero when they are perpendicular. The cross product returns a vector perpendicular to both inputs, and its length |a| |b| sin θ is largest when they are perpendicular and zero when they are parallel. The dot product works in any dimension, while the cross product is defined for 3D vectors.
Can I take the cross product of two 2D vectors?
Not as a true 2D vector, but you can treat each one as a 3D vector with a z component of 0. Then a × b = ⟨0, 0, a₁b₂ − a₂b₁⟩, so ⟨7, 1⟩ and ⟨3, 4⟩ give ⟨0, 0, 25⟩. The single number a₁b₂ − a₂b₁, often called the 2D cross product, has an absolute value equal to the area of the parallelogram the vectors span, and its sign tells you whether b turns counterclockwise (positive) or clockwise (negative) from a.
How can I tell if two vectors are parallel or orthogonal?
Two nonzero vectors are orthogonal when their dot product is exactly 0, as with ⟨2, −1, 4⟩ and ⟨3, 2, −1⟩: 6 − 2 − 4 = 0. They are parallel when their cross product is the zero vector, which happens when one is a scalar multiple of the other, as with ⟨1, −2, 3⟩ and ⟨−2, 4, −6⟩, which is −2 times the first. This calculator runs both tests with exact fractions, so rounding cannot produce a false answer.
How do I project one vector onto another?
The vector projection of a onto b is proj_b a = ((a · b) / |b|²) b, and the scalar projection, the signed length of that shadow, is (a · b) / |b|. For a = ⟨7, 1⟩ and b = ⟨3, 4⟩, a · b = 25 and |b|² = 25, so the projection is exactly ⟨3, 4⟩ and the scalar projection is 5. The part left over, a − proj_b a = ⟨4, −3⟩, is perpendicular to b.
What is the scalar triple product used for?
The scalar triple product a · (b × c) equals the determinant of the 3 × 3 matrix whose rows are a, b and c. Its absolute value is the volume of the parallelepiped with those three edges, and one sixth of it is the volume of the tetrahedron they form. For a = ⟨3, −2, 5⟩, b = ⟨1, 4, −2⟩ and c = ⟨2, 0, 1⟩ it equals −18, so the volume is 18. A result of 0 means the three vectors lie in one plane.
💡 Good to know
Lagrange's identity is a free error check
For any two 3D vectors, |a × b|² = |a|²|b|² − (a · b)². With the worked example that is 573 = 38 × 21 − 225. If your cross product's squared length does not match, one of its components is wrong.
i × j = k, and the order matters
The basis vectors cycle forward: i × j = k, j × k = i and k × i = j. Going backward flips the sign, so j × i = −k, and any vector crossed with itself gives the zero vector. Load the i, j, k preset to see the first product and a triple product of exactly 1.
The 2D cross product tells left from right
The sign of a₁b₂ − a₂b₁ says which way you turn to get from a to b: positive means counterclockwise, negative means clockwise and zero means the vectors are parallel. For ⟨7, 1⟩ and ⟨3, 4⟩ it is +25, so b lies counterclockwise from a.