Angle Between Vectors Calculator

Calculate the angle between two 2D or 3D vectors using the dot product formula. Includes magnitudes, dot product, cross product, projection, parallel/perpendicular detection, and visual gauge.

Presets

Vector A

Vector B

Planning notes, formulas, and examples

About the Angle Between Vectors Calculator

The angle between two vectors is a fundamental concept in linear algebra, physics, computer graphics, and machine learning. It measures how much two directions diverge, from 0° (perfectly aligned) through 90° (perpendicular) to 180° (opposite). The standard formula uses the dot product: cos θ = (A · B) / (|A| |B|).

This calculator handles both 2D and 3D vectors. Enter the components of each vector and see the angle in degrees and radians, the dot product, the cross product (full 3D vector or scalar z-component for 2D), the magnitude of each vector, the cosine of the angle, and the scalar and vector projections.

Parallel and perpendicular relationships are detected automatically. Parallel vectors (0° or 180°) have a dot product equal to ±|A||B|, while perpendicular vectors have a dot product of exactly zero. These checks are essential in physics (force decomposition), computer graphics (normal testing), and data science (cosine similarity).

The visual angle gauge gives a quick intuitive sense of where your angle falls on the 0°–180° spectrum. The magnitude comparison bar chart shows |A|, |B|, |A+B|, and |A−B|, illustrating the triangle inequality and parallelogram law. A reference table of notable angles (0°, 30°, 45°, 60°, 90°, etc.) helps put your result in context.

Presets demonstrate classic cases — orthogonal basis vectors, 45° diagonals, parallel and anti-parallel pairs — making it easier to build intuition or verify your understanding.

When This Page Helps

Use this page when the angle is only one part of the vector comparison. It keeps the dot product, magnitudes, projection, and cross-product information together so you can see why the angle has its reported value and how the vectors relate geometrically.

How to Use the Inputs

  1. Choose 2D or 3D vector mode.
  2. Enter the components of Vector A (Ax, Ay, and optionally Az).
  3. Enter the components of Vector B (Bx, By, and optionally Bz).
  4. Or click a preset to load a common example.
  5. Read the angle in degrees and radians, dot/cross products, magnitudes, and more.
  6. Check the relationship: parallel, perpendicular, acute, or obtuse.
  7. View the angle gauge and magnitude bar chart for visual context.
Formula used
cos θ = (A · B) / (|A| · |B|) Dot product: A · B = Ax·Bx + Ay·By + Az·Bz Cross product (3D): A × B = (AyBz − AzBy, AzBx − AxBz, AxBy − AyBx) |V| = √(Vx² + Vy² + Vz²) Projection of A onto B: proj = (A·B / |B|²) · B Scalar projection: comp = A·B / |B|

Example Calculation

Result: A right angle between the sample vectors

With one sample vector aligned to the x-axis and the comparison vector orthogonal to it, the dot product becomes 0, which means the vectors meet at 90°. The other outputs confirm that through magnitudes and projections.

Tips & Best Practices

  • If the dot product is zero, the vectors are perpendicular — this is a fast orthogonality test.
  • Cosine similarity in machine learning is exactly cos θ = A·B / (|A||B|); this calculator computes it directly.
  • The cross product magnitude |A×B| = |A||B|sin θ gives the area of the parallelogram spanned by A and B.
  • For 2D vectors, the cross product is a scalar (the z-component), and its sign tells you the rotation direction.
  • Normalize both vectors to unit length first if you only care about direction, not magnitude.

When To Use This Calculator

Calculate the angle between two 2D or 3D vectors using the dot product formula. Includes magnitudes, dot product, cross product, projection, parallel/perpendicular detection, and visual gauge. Use it when you need a repeatable calculation in the math / geometry category and want the setup, result, and supporting values kept together. This is especially helpful when small input changes, unit choices, or rounding decisions can change the final number.

How To Check The Result

Start by confirming that the inputs match the formula shown on the page. Then compare the main output with the worked example and any secondary values shown by the calculator. If the result will be used in another calculation, keep extra precision until the final step and record the assumptions beside the number.

Practical Notes

Treat the result as a calculation aid rather than a substitute for context. For schoolwork, include the formula and substitution steps. For planning, technical, financial, or health-related decisions, verify important numbers against primary records, current rules, or a qualified professional before acting on them.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • Use the dot product formula: θ = arccos((A·B) / (|A|·|B|)). Compute the dot product, divide by the product of magnitudes, and take the inverse cosine.