MathLive Logo

3D Vector Analysis

Define vectors A and B, then compute and visualize.
Define $\vec{A}$
Define $\vec{B}$
Tip: θ is the polar angle (from +z, 0→π). φ is azimuth about +z (0→2π).

Results & Visualization

Vector Addition and Subtraction
Vector Cross Product

How the 3D Vector Calculator Works

Define two vectors $\vec{A}$ and $\vec{B}$ in any of three ways: by their components (x, y, z), by two points (the vector goes from the first point to the second), or in spherical form (r, θ, φ), where θ is the polar angle measured from the +z axis and φ is the azimuth around it. Spherical input is converted with x = r·sinθ·cosφ, y = r·sinθ·sinφ and z = r·cosθ. Press Solve and Plot to see every result with its formula and substituted values, plus two interactive 3D plots you can rotate and zoom.

The calculator finds the magnitudes $|\vec{A}|$ and $|\vec{B}|$, the sums and differences $\vec{A}+\vec{B}$, $\vec{A}-\vec{B}$ and $\vec{B}-\vec{A}$, the dot product (scalar product) $\vec{A}\cdot\vec{B} = a_x b_x + a_y b_y + a_z b_z$, the angle between the vectors from $\cos\theta = \vec{A}\cdot\vec{B} \,/\, (|\vec{A}||\vec{B}|)$, and the cross product (vector product) $\overrightarrow{A\times B}$ from the 3×3 determinant with $\hat{\imath}$, $\hat{\jmath}$, $\hat{k}$ in the first row.

Worked example

For $\vec{A} = (1, 1, 0)$ and $\vec{B} = (2, 1, 2)$: $|\vec{A}| = \sqrt{2} \approx 1.4142$ and $|\vec{B}| = 3$. $\vec{A}\cdot\vec{B} = 2 + 1 + 0 = 3$, so $\cos\theta = 3/(3\sqrt{2})$ and θ = 45°. $\overrightarrow{A\times B} = (1\cdot 2 - 0\cdot 1,\ 0\cdot 2 - 1\cdot 2,\ 1\cdot 1 - 1\cdot 2) =$ (2, −2, −1), whose magnitude 3 equals the area of the parallelogram spanned by $\vec{A}$ and $\vec{B}$.

Frequently asked questions

What is the difference between the dot and cross product?

The dot product (also called the scalar product) gives a number, a scalar, not a vector: $\vec{A}\cdot\vec{B} = |\vec{A}||\vec{B}|\cos\theta$, where θ is the angle between the two vectors. It measures how much the two vectors point the same way; it is positive when the angle is less than 90°, zero when they are perpendicular and negative when the angle is more than 90°.

The cross product (also called the vector product) gives a new vector $\overrightarrow{A\times B}$, perpendicular to both $\vec{A}$ and $\vec{B}$, with magnitude $|\overrightarrow{A\times B}| = |\vec{A}||\vec{B}|\sin\theta$. This magnitude equals the area of the parallelogram spanned by $\vec{A}$ and $\vec{B}$, and it is zero when the vectors are parallel.

Which way does $\overrightarrow{A\times B}$ point?

By the right-hand rule: curl the fingers of your right hand from $\vec{A}$ towards $\vec{B}$ and your thumb points along $\overrightarrow{A\times B}$. Swapping the order reverses it: $\overrightarrow{B\times A} = -\overrightarrow{A\times B}$.

When is the angle undefined?

If either vector has zero magnitude, the angle cannot be computed, because there is no direction to measure from.

How do I rotate the 3D plots?

Drag inside a plot to rotate it, scroll or pinch to zoom, and use the toolbar to reset the view.