Angle Between Two Vectors Calculator logo

Angle Between Two Vectors Calculator

Choose 2D or 3D, enter vector a and vector b as coordinates or as point pairs, then get the angle in degrees and radians. All math runs locally in your browser.

Vectors in

Switch dimension and representation per vector. Point mode uses the displacement from the first point to the second.

Vectors in

Vector a

Representation system

Vector b

Representation system

Angle between vectors

What is a vector angle?

Community rating 4.9/5 · 142 reviews

What Is the Angle Between Two Vectors?

The angle between two nonzero vectors measures how far their directions differ. It is the rotation needed in the plane they span to carry one direction onto the other, reported from 0° to 180° in 2D and 3D alike. Magnitude does not change the angle: scaling a vector leaves direction unchanged.

In vector algebra and geometry, this angle compares direction, not position. Two arrows with the same slope but different start points still share the same angle if their displacements are parallel. That is why we work with direction vectors built from components or from point pairs.

The geometric picture is a wedge between two rays from a common origin. In physics and engineering you meet the same idea when force, velocity, or member axes are drawn as vectors and you need the angle before resolving components or computing work.

You almost always compute the angle with the dot product and magnitudes. Start with what is the angle between two vectors, then see dot product and vector angle or how to find the angle step by step.

Angle Between Two Vectors Formula

cos θ = (a · b) / (|a| |b|)

θ = arccos( (a · b) / (|a| |b|) )

Dot product (components): a · b = aₓbₓ + aᵧbᵧ + a_z b_z

Magnitude: |a| = √(aₓ² + aᵧ² + a_z²)

Cosine rule for directions: when |a| and |b| are nonzero, the ratio lies in [-1, 1].

This is the standard cosine formula for vectors. The dot product captures how much two directions align. Dividing by |a||b| normalizes lengths so only direction matters. arccos then returns the angle in radians; multiply by 180/π for degrees.

If a · b equals |a||b|, the vectors point the same way and θ = 0°. If a · b equals -|a||b|, they are anti-parallel and θ = 180°. A zero dot product with nonzero lengths means perpendicular directions and θ = 90°.

The formula assumes both vectors are nonzero. It describes the geometric angle between directions, not a signed twist about an arbitrary axis in 3D.

How to Calculate the Angle Between Two Vectors

Whether you work on paper or in the calculator above, the pipeline is the same: build both vectors, dot them, divide by the product of magnitudes, then apply inverse cosine.

  1. Write both vectors in component form Use coordinates directly, or subtract start from end for each point pair. Keep 2D problems in 2D unless a z component is part of the data.
  2. Find the dot product Multiply matching components and add: a · b = aₓbₓ + aᵧbᵧ + a_z b_z.
  3. Calculate each magnitude Square components, sum, and take the square root for |a| and |b|.
  4. Divide and apply inverse cosine Form cos θ = (a · b) / (|a||b|). Clamp to [-1, 1] if rounding pushes you outside, then θ = arccos(cos θ).
  5. Verify the result Check against special cases (parallel, perpendicular) or plug the same numbers into the calculator to confirm degrees and radians.

Coordinate mode enters components as they are. Point mode builds displacements first; see coordinate vs point input when you are unsure which to pick.

Angle Between Two Vectors Examples

Five quick patterns you can re-run in the calculator: perpendicular and oblique 2D cases, a 3D example, parallel directions, and a physics-style velocity check.

Perpendicular 2D vectors

Let a = (1, 0) and b = (0, 1) in Coordinate mode, 2D.

  1. Dot product: a · b = 1·0 + 0·1 = 0.
  2. Magnitudes: |a| = 1 and |b| = 1.
  3. Angle: cos θ = 0, so θ = 90°.

Result: 90° (π/2 radians): orthogonal vectors.

Oblique 2D vectors from points

a from (0, 0) to (3, 0) gives (3, 0). b from (0, 0) to (3, 4) gives (3, 4). Use Point mode for both.

  1. Dot product: a · b = 3·3 + 0·4 = 9.
  2. Magnitudes: |a| = 3, |b| = 5.
  3. Angle: cos θ = 9/15 = 0.6, θ ≈ 53.13°.

Result: About 53.13° (0.9273 radians).

3D coordinate vectors

a = (1, 0, 0) and b = (0, 1, 0) in 3D Coordinate mode.

  1. Dot product: a · b = 0.
  2. Magnitudes: Both lengths are 1.
  3. Angle: θ = 90° in the xy-plane.

Result: 90°: perpendicular in 3D space.

Parallel vectors (same direction)

a = (2, 4) and b = (1, 2). Note b is a positive scalar multiple of a.

  1. Dot product: a · b = 2·1 + 4·2 = 10.
  2. Magnitudes: |a| = √20, |b| = √5.
  3. Angle: cos θ = 10 / (√20·√5) = 1.

Result: 0°: parallel, same direction.

Physics-style velocity directions

Velocity a = (30, 40) m/s and b = (50, 0) m/s (components only; units cancel in the ratio).

  1. Dot product: a · b = 30·50 + 40·0 = 1500.
  2. Magnitudes: |a| = 50, |b| = 50.
  3. Angle: cos θ = 1500/2500 = 0.6.

Result: About 53.13° between heading directions.

Dot Product Calculator

a · b = |a| |b| cos θ

cos θ = (a · b) / (|a| |b|)

The dot product is the bridge between algebra and angle. For a = (aₓ, aᵧ, a_z) and b = (bₓ, bᵧ, b_z), the component form a · b = aₓbₓ + aᵧbᵧ + a_z b_z is what you evaluate before every angle calculation on this page.

Geometrically, a · b = |a||b| cos θ. That identity is why the angle formula divides the dot product by |a||b|. When cos θ is near 1, directions align; near 0, they are perpendicular; near -1, they oppose.

In machine learning and search, cosine similarity uses the same ratio without always naming θ. Graphics and robotics use dot products for lighting, facing checks, and projection onto axes.

This tool focuses on θ, but every result you see here already computed a · b internally. Read dot product and vector angle explained or angle between two vectors and dot product for the combined view.

Angle Between Two 3D Vectors

In three dimensions you still use θ = arccos((a · b)/(|a||b|)). Add a z component to the dot product and to each magnitude; the angle is the geometric angle between directions in space, not a full azimuth-elevation pair unless your application defines one.

Spatial geometry problems (normals, forces in 3D, joint axes) often ship as two coordinate triples. Engineering and physics students switch to 3D when the data includes height, depth, or a third axis.

Visualization helps: sketch both vectors from the origin, identify the plane they span, and estimate whether the angle should be acute or obtuse before you trust a calculator readout.

Select 3D in the calculator and enter z for each vector, or use Point mode with from/to triples. Our article on when to use 2D vs 3D walks through common mistakes.

Parallel and Perpendicular Vectors

Parallel vectors point the same way: one is a positive scalar multiple of the other and the angle is 0°. Anti-parallel vectors point oppositely; the angle is 180° and the dot product is negative with magnitude |a||b|.

Perpendicular (orthogonal) vectors meet at 90°. In component form, a · b = 0 with nonzero lengths signals orthogonality. Identification shortcuts: compare ratios of components for parallelism; test a · b = 0 for perpendicularity.

These special cases are worth checking before you publish an answer. They also sanity-check 3D data where rounding can push cos θ slightly outside [-1, 1].

Angle Between Two Vectors and Dot Product

The dot product and the angle formula are two views of the same fact. Algebra gives a · b from components; geometry interprets that number through cos θ. Dividing by |a||b| isolates cosine so arccos can recover θ.

Vector projection is the other sibling idea: projecting a onto b uses (a · b / |b|²) b. Similarity metrics in data science often use cos θ directly because it ignores vector length.

A common misconception is treating raw point coordinates as vectors without subtracting a start point. Another is expecting a signed spin about an axis; this page reports the standard geometric angle between directions (0° to 180°).

Angle Between Two Vectors Calculator

The interactive panel at the top of this page is the calculator: 2D or 3D, coordinate or point input per vector, degrees and radians in one result block. Everything runs locally; nothing is uploaded.

Use it when homework, CAD exports, or notebook checks need a fast θ without setting up a spreadsheet. See how to use this calculator for a full walkthrough; worked examples below mirror the same steps after you tap Calculate angle.

  1. Choose 2D or 3D for both vectors.
  2. For each vector, pick Coordinate (components) or Point (from → to displacement).
  3. Fill every required field, then tap Calculate angle.
  4. Read degrees and radians; fix inputs if a zero-length vector error appears.

Vector Projection Calculator

Scalar projection onto b: comp_b(a) = (a · b) / |b|

Vector projection onto b: proj_b(a) = ((a · b) / |b|²) b

Projection answers how much of vector a lies along vector b. The scalar along b is (a · b) / |b|; the vector projection is ((a · b) / |b|²) b when b is nonzero. That uses the same dot product you already compute for angles.

Engineers use projections to resolve forces onto ramps or members. Graphics uses them for shadows and lighting along a chosen axis. Once θ is known, you can also write the component along b as |a| cos θ, consistent with the dot product definition.

This site does not host a separate projection tool yet; find θ here first, then apply the projection formulas with the magnitudes you already have. Read vector projection calculator for worked projection steps tied to the same dot product.

Where Vector Angles Appear

Comparing directions is the shared thread across these fields. Each use case maps to the same dot-product angle you calculate here.

  • Vector algebra and geometry

    Angle proofs, direction comparisons, and coordinate geometry problems.

  • Physics

    Work W = F·d cos θ, velocity headings, force resolution on inclines.

  • Engineering

    Member forces, structural joints, and machine kinematics in 2D and 3D.

  • Computer graphics

    Normals vs light rays, camera facing, and shading models.

  • Machine learning

    Cosine similarity between embedding vectors and feature vectors.

  • Game development

    Field of view, aim cones, and steering between direction vectors.

Common Vector Angle Calculation Mistakes

Most wrong angles trace back to representation, dimension, or expecting the wrong kind of angle. Fix the vectors first, then trust arccos.

FAQs About the Angle Between Two Vectors

What is the angle between two vectors?

It is the geometric angle between their directions, from 0° to 180°, found with θ = arccos((a·b)/(|a||b|)) for nonzero vectors.

Can vector a use Coordinate while vector b uses Point?

Yes. Each vector has its own representation toggle. The calculator builds a and b separately, then applies the same angle formula.

How do you find the angle between two vectors in 3D?

Use the same formula with x, y, and z components in the dot product and magnitudes. Switch the calculator to 3D and include every z value.

What does a dot product of zero mean?

If both vectors are nonzero, a · b = 0 means they are perpendicular and the angle is 90°.

Why is the angle between (1, 0) and (-1, 0) equal to 180°?

Those vectors are anti-parallel. The dot product is negative, so θ = 180°. Same-direction parallels give 0°.

What is the difference between parallel and perpendicular vectors?

Parallel vectors share direction (0° or 180° if reversed). Perpendicular vectors meet at 90° and have dot product zero when lengths are nonzero.

Does the calculator store my numbers?

No. Values stay in your browser session. The page is static and does not send inputs to a backend.

What happens if a vector has length zero?

The angle is undefined because division by |a| or |b| is impossible. The tool shows an error asking you to fix the inputs.