Perpendicular 2D vectors
Let a = (1, 0) and b = (0, 1) in Coordinate mode, 2D.
- Dot product: a · b = 1·0 + 0·1 = 0.
- Magnitudes: |a| = 1 and |b| = 1.
- Angle: cos θ = 0, so θ = 90°.
Result: 90° (π/2 radians): orthogonal vectors.
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.
Switch dimension and representation per vector. Point mode uses the displacement from the first point to the second.
Representation system
Representation system
Angle between 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.
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.
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.
Coordinate mode enters components as they are. Point mode builds displacements first; see coordinate vs point input when you are unsure which to pick.
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.
Let a = (1, 0) and b = (0, 1) in Coordinate mode, 2D.
Result: 90° (π/2 radians): orthogonal vectors.
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.
Result: About 53.13° (0.9273 radians).
a = (1, 0, 0) and b = (0, 1, 0) in 3D Coordinate mode.
Result: 90°: perpendicular in 3D space.
a = (2, 4) and b = (1, 2). Note b is a positive scalar multiple of a.
Result: 0°: parallel, same direction.
Velocity a = (30, 40) m/s and b = (50, 0) m/s (components only; units cancel in the ratio).
Result: About 53.13° between heading directions.
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.
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 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].
b = k a with positive k. Dot product equals |a||b|.
b = k a with negative k. Dot product equals -|a||b|.
a · b = 0 with nonzero lengths.
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°).
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.
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.
Comparing directions is the shared thread across these fields. Each use case maps to the same dot-product angle you calculate here.
Angle proofs, direction comparisons, and coordinate geometry problems.
Work W = F·d cos θ, velocity headings, force resolution on inclines.
Member forces, structural joints, and machine kinematics in 2D and 3D.
Normals vs light rays, camera facing, and shading models.
Cosine similarity between embedding vectors and feature vectors.
Field of view, aim cones, and steering between direction vectors.
Most wrong angles trace back to representation, dimension, or expecting the wrong kind of angle. Fix the vectors first, then trust arccos.
It is the geometric angle between their directions, from 0° to 180°, found with θ = arccos((a·b)/(|a||b|)) for nonzero vectors.
Yes. Each vector has its own representation toggle. The calculator builds a and b separately, then applies the same angle formula.
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.
If both vectors are nonzero, a · b = 0 means they are perpendicular and the angle is 90°.
Those vectors are anti-parallel. The dot product is negative, so θ = 180°. Same-direction parallels give 0°.
Parallel vectors share direction (0° or 180° if reversed). Perpendicular vectors meet at 90° and have dot product zero when lengths are nonzero.
No. Values stay in your browser session. The page is static and does not send inputs to a backend.
The angle is undefined because division by |a| or |b| is impossible. The tool shows an error asking you to fix the inputs.