Skip to content
FiftyCalc Free calculators for all 50 states

Vector Calculator

Test cases replayed : 3 of 3 match · Methodology · No outside source listed

Enter two vectors a and b by their components to get their dot and cross products, lengths and the angle between them.

Result

Sample figures

Dot product a · b—

Cross product a × b: x —

  • Cross product a × b: y—
  • Cross product a × b: z—
  • Magnitude |a|—
  • Magnitude |b|—
  • Angle between a and b (degrees)—
  • Scalar projection of a on b—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Vector Calculator

a: x component: enter a number. Prefilled example: 1.

a: y component: enter a number. Prefilled example: 2.

a: z component (0 for 2D): enter a number. Prefilled example: 3.

b: x component: enter a number. Prefilled example: 4.

b: y component: enter a number. Prefilled example: 5.

b: z component (0 for 2D): enter a number. Prefilled example: 6.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. a: x component: enter a number.
  2. a: y component: enter a number.
  3. a: z component (0 for 2D): enter a number.
  4. b: x component: enter a number.
  5. b: y component: enter a number.
  6. b: z component (0 for 2D): enter a number.
  7. Read the result: Dot product a · b; the panel also shows Cross product a × b: x, Cross product a × b: y, Cross product a × b: z, Magnitude |a|, Magnitude |b|, Angle between a and b (degrees) and Scalar projection of a on b.

How this calculator works

Dot product: a · b = aₓbₓ + a_yb_y + a_zb_z = |a||b| cos θ, so the angle is θ = arccos(a · b ÷ (|a||b|)).

Cross product: a × b = (a_yb_z − a_zb_y, a_zbₓ − aₓb_z, aₓb_y − a_ybₓ), a vector perpendicular to both whose length |a||b| sin θ is the area of the parallelogram they span.

Magnitude |a| = √(aₓ² + a_y² + a_z²); scalar projection of a on b = a · b ÷ |b|.

The formula

  1. Dot=ax×bx+ay×by+az×bz
Symbols used in the formula
SymbolMeaning
axa: x component
aya: y component
aza: z component (0 for 2D)
bxb: x component
byb: y component
bzb: z component (0 for 2D)
DotDot product a · b

Worked example

a: x component1
a: y component2
a: z component (0 for 2D)3
b: x component4
b: y component5
b: z component (0 for 2D)6
Cross product a × b: x-3
Cross product a × b: y6
Cross product a × b: z-3
Magnitude |a|3.7417
Magnitude |b|8.775
Angle between a and b (degrees)12.9332
Scalar projection of a on b3.6467
  1. Dot=1×4+2×5+3×6=32

Dot product a · b 32

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What does a dot product of 0 mean?

The vectors are perpendicular (at 90°), as long as neither is the zero vector.

What is the difference between the dot and cross product?

The dot product is a number measuring how much two vectors point the same way; the cross product is a vector perpendicular to both.

Does the order matter in a cross product?

Yes: b × a = −(a × b), the same length pointing the opposite way.

Related calculators