Angle Between Two Vectors Calculator
Enter the components of two 3D vectors to find the angle between them.
Result
How it is calculated
For vectors a = (ax, ay, az) and b = (bx, by, bz) the tool computes the dot product a·b = ax·bx + ay·by + az·bz and the lengths |a| = √(ax² + ay² + az²) and |b| likewise. The angle follows from cos θ = a·b ÷ (|a| × |b|), so θ = arccos(cos θ). It is shown in degrees (two decimals) and in radians (four decimals), along with the dot product itself.
All six components are required; for a 2D problem enter 0 for the z components. The result is always between 0° and 180°, since it is the smaller angle between the two directions. If either vector is all zeros the angle is undefined and the tool shows nothing. The ratio is clamped to the range −1 to 1 before taking the arccosine, so tiny rounding errors for parallel vectors do not cause an error. Components may be negative or decimal, and no units are needed.
Worked example
Take a = (1, 2, 3) and b = (4, 5, 6). The dot product is 1×4 + 2×5 + 3×6 = 4 + 10 + 18 = 32. The lengths are |a| = √14 ≈ 3.7417 and |b| = √77 ≈ 8.7750. Then cos θ = 32 ÷ (3.7417 × 8.7750) ≈ 0.9746, and arccos of that gives 12.93°, which is 0.2257 rad. The two vectors point in nearly the same direction, so the angle is small and the dot product 32.00 is large and positive.
Common mistakes
- Leaving a component blank, such as the z value of a 2D vector. All six fields are required, so enter 0.
- Entering the points of a line instead of the vector. If you have start and end points, subtract them first to get the components.
- Expecting an angle above 180°. The result is the smaller angle between the vectors, never more than 180°.
- Using the zero vector, which has no direction, so the angle cannot be found.
- Reading a negative dot product as an error. It simply means the angle is greater than 90°.
About this calculator
The angle between two vectors comes straight from the dot product formula: cos θ = (a · b) / (|a| |b|), where a · b is the sum of the products of matching components and |a|, |b| are the vectors' magnitudes. Taking the arccosine of that ratio gives θ directly, in radians, which this calculator also converts to degrees.
This is one of the most-used relationships in 3D math: computer graphics and game engines use it for lighting calculations and collision detection, physicists use it to resolve forces and torques, and robotics engineers use it for joint angles and motion planning. Because the dot product is zero exactly when vectors are perpendicular, this formula also doubles as the standard test for orthogonality.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Besides the angle, the sign of the dot product gives a quick sanity check: positive means under 90 degrees, zero means exactly 90, negative means more. For example, (1, 1, 0) and (1, -1, 0) have dot 0.00 and 90.00 degrees, and (1, 0, 0) with (-2, 0, 0) gives 180.00 degrees and dot -2.00. For flat 2D problems, put 0 in the z boxes. Which field are you using this in, graphics, physics or something else?