Skip to content
EN
  • Español
  • English
Advertisement

Vector calculator: magnitude, dot and cross product

Work out the magnitude, sum, difference, dot product and cross product of two vectors in 2D or 3D, the angle between them and the projection of one on the other.

Fill in 2 of the 3 fields and the missing one is calculated. You can type in any of them.

—
—
In 2D, leave it at 0.
—
—
—
—
—
Magnitude of v—
Dot product u · v—
Angle between u and v—
u + v: x—
u + v: y—
u + v: z—
Magnitude of u + v (resultant)—
u − v: x—
u − v: y—
u − v: z—
Cross product u × v: x—
u × v: y—
u × v: z—
|u × v| (parallelogram area)—
Projection of u on v—
Angle of u with the x axis (in the xy plane)—

Use this calculator for reference only, as we cannot guarantee that the results are free of errors.

Disclaimer

https://dyaii.es/en/vector-calculator/

Advertisement

A vector has magnitude (size), direction and sense: a force, a velocity, a displacement. It is written with its components along the axes, u = (ux, uy, uz). With two vectors, the calculator gives their magnitudes, sum and difference, dot product, cross product, the angle between them and the projection of one on the other, on the plane (z = 0) or in space. Drag the arrow tips on the drawing to see everything change.

Magnitude, sum and difference

|u| = √(ux² + uy² + uz²)  ·  u ± v = (ux ± vx, uy ± vy, uz ± vz)

They are added component by component; on the drawing it is the parallelogram rule (or placing one vector after the other). The sum of forces is the resultant. Example: u = (3, 4) has magnitude 5; with v = (4, −1), u + v = (7, 3), magnitude 7.62.

Dot product and angle

u · v = ux·vx + uy·vy + uz·vz = |u| · |v| · cos θ

It gives a number. It is positive if the vectors make less than 90°, zero if they are perpendicular and negative if more. Solving, cos θ = u · v / (|u| · |v|). With (3, 4) and (4, −1): u · v = 12 − 4 = 8 and θ = arccos(8 / (5 · 4.123)) = 67.2°. The work of a force is a dot product: W = F · d.

proj_v u = u · v / |v|

The projection is the shadow of u on the direction of v: 8 / 4.123 = 1.94.

Advertisement

Cross product

u × v = (uy·vz − uz·vy, uz·vx − ux·vz, ux·vy − uy·vx)  ·  |u × v| = |u| · |v| · sin θ

It gives a vector perpendicular to both, with the sense of the right-hand rule, and its magnitude is the area of the parallelogram they form. It only exists in 3D (in 2D only the z component comes out). It is the moment of a force (M = r × F) and the force on a charge or a conductor in a magnetic field (F = q · v × B).

Several ways to get each value

  • Everything from the components of both vectors. Drag their tips on the drawing.
  • A missing component from the magnitude: enter the magnitude of u and clear, for example, uy. With ux = 5 and |u| = 13, uy = 12.
  • From magnitude and angle to components: ux = |u| · cos α, uy = |u| · sin α (α from the x axis); the angle of u with the x axis is in the results.
Advertisement

Frequently asked questions

How is the magnitude of a vector calculated?

With Pythagoras: |u| = √(ux² + uy² + uz²). The vector (3, 4) has magnitude √(9 + 16) = 5.

How is the dot product calculated?

Multiply component by component and add: u · v = ux·vx + uy·vy + uz·vz. With (3, 4) and (4, −1): 12 − 4 = 8. If it is zero, the vectors are perpendicular.

What angle do two vectors make?

cos θ = u · v / (|u| · |v|). With (3, 4) and (4, −1): 8 / (5 · 4.123) = 0.388, θ = 67.2°.

What is the cross product used for?

It gives a vector perpendicular to both, with magnitude equal to the area of the parallelogram they form. In physics it is the moment of a force (M = r × F) or the force on a conductor in a magnetic field.

Related calculators

Share

WhatsApp X LinkedIn Telegram Email
Advertisement

Install Diseño y automatización de instalaciones industriales on your phone

All the calculators one tap away, full screen, like an app. It takes no space and is always up to date.