AI Tools Free

Vector Angle Calculator

Enter the Cartesian components First vector (x, y, z) and Second vector (x, y, z) into this vector angle calculator to find the interior angle theta in [0°, 180°] in degrees between any two non-zero vectors. Leave both z-coordinates at 0 for 2D planar vectors, test the preloaded (1, 0, 0) and (0, 1, 0) -> 90° orthogonal pair, or evaluate 3D coordinates up to +-1,000,000,000.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Calculate.

Your result
Enter your details

Result will appear here

How to Calculate Angle Between Two Vectors & Core Formula

Learning how to calculate angle between two vectors relies on the geometric definition of the Euclidean dot product: a . b = ||a|| * ||b|| * cos(theta). Dividing the scalar dot product xu + yv + zw by the product of the two Euclidean lengths ||a|| = sqrt(x^2 + y^2 + z^2) and ||b|| = sqrt(u^2 + v^2 + w^2) isolates cos(theta). Applying the inverse cosine (arccos) returns the unique interior angle in radians on [0, pi], which converts to degrees on [0°, 180°] by multiplying by 180° / pi.

theta = arccos((x*u + y*v + z*w) / (sqrt(x^2 + y^2 + z^2) * sqrt(u^2 + v^2 + w^2))) * (180° / pi)

In client-side JavaScript (batch11-core.js), the vectorAngle() helper first computes each vector's length via overflow-safe Math.hypot(x, y, z) and Math.hypot(u, v, w), then sums the normalized coordinate products (a_i / ||a||)*(b_i / ||b||) using Kahan compensated summation. Finally, it clamps the cosine to [-1, 1] via Math.max(-1, Math.min(1, cos)) before calling Math.acos(cos) * 180 / Math.PI, preventing NaN rounding errors when two collinear vectors yield a floating-point cosine like 1.0000000000000002.

Diagram showing how to calculate the angle between two 3D vectors using dot product and magnitudes
Geometric diagram of vectors a and b sharing an origin with interior angle theta, dot product projection, and arccosine formula.

Angle Between Two Vectors Quick Reference Table

Use this reference table to verify common 2D and 3D vector pairs, dot-product cosines, and exact degree angles before entering your own coordinates into the angle between two vectors calculator.

Vector Pair ScenarioFirst Vector a = (x, y, z)Second Vector b = (u, v, w)Cosine cos(theta)Angle theta (Degrees)Geometric Relationship
Orthogonal x and y Axes (Preloaded)(1, 0, 0)(0, 1, 0)0 / (1 x 1) = 090°Perpendicular basis axes (a perp b)
Parallel Co-Directional Vectors(2, 4, 4)(1, 2, 2)18 / (6 x 3) = 10°Collinear vectors pointing in the same direction
Antiparallel Opposite Vectors(3, -4, 0)(-3, 4, 0)-25 / (5 x 5) = -1180°Collinear vectors pointing in opposite directions
2D Diagonal & Horizontal Axis(1, 1, 0)(1, 0, 0)1 / (sqrt(2) x 1) = 0.70710745°Bisector of Quadrant I in the xy-plane
3D Cube Adjacent Face Diagonals(1, 1, 0)(1, 0, 1)1 / (sqrt(2) x sqrt(2)) = 0.560°Equilateral triangle formed by face diagonals
3D Cube Space Diagonal & Edge(1, 1, 1)(1, 0, 0)1 / (sqrt(3) x 1) = 0.57735054.7356103172°Magic angle (arccos(1/sqrt(3))) in crystallography
2D 30-60-90 Triangle Pair(1.73205080757, 1, 0)(1, 0, 0)sqrt(3) / 2 = 0.86602530°Standard 30-degree elevation above the +x axis
Obtuse 120-Degree Pair(-1, 1, 0)(1, 0, 1)-1 / (sqrt(2) x sqrt(2)) = -0.5120°Supplementary obtuse angle (cos 120° = -0.5)
Tetrahedral Bond Vectors (sp3)(1, 1, 1)(1, -1, -1)-1 / (sqrt(3) x sqrt(3)) = -1/3109.471220634°Methane (CH4) tetrahedral bond angle
Obtuse 2D Diagonal Pair(-1, 1, 0)(1, 0, 0)-1 / (sqrt(2) x 1) = -0.707107135°Quadrant II diagonal relative to +x axis

Step-by-Step Guide to Using the Vector Angle Calculator

Follow these three steps to enter both vectors, handle 2D or 3D coordinates, and copy your degree result.

Enter the First Vector Coordinates

Type the coordinates of your initial vector a into First vector x (#x, default 1), First vector y (#y, default 0), and First vector z (#z, default 0).

Input and settings
Step 1 entering First vector x, y, and z in the Vector Angle Calculator
First vector input fields x=1, y=0, z=0 inside the Vector Angle Calculator workspace.

Enter the Second Vector Coordinates

Populate Second vector x (#u), Second vector y (#v, preloaded with 1), and Second vector z (#w). Leave both vertical z-axis fields at 0 whenever your vectors lie in a 2D plane.

Tool result
Step 2 entering Second vector x, y, and z in the Vector Angle Calculator
Second vector input fields u=0, v=1, w=0 configured for an orthogonal 90-degree check.

Calculate and Export the Angle

Click Calculate result to compute the interior angle in degrees (°). Use Copy or Download to save the value for statics diagrams, 3D graphics shaders, or calculus assignments.

Review the details
Step 3 viewing the 90-degree output in the Vector Angle Calculator
Result panel showing 90° with Copy and Download buttons enabled.

Practical Worked Examples to Calculate Angle Between Two Vectors

These three scenarios demonstrate how to calculate angle between two vectors for perpendicular axes, 3D crystal diagonals, and obtuse force vectors.

Orthogonal Basis Axes: (1, 0, 0) and (0, 1, 0)

With the preloaded values a = (1, 0, 0) and b = (0, 1, 0), the dot product is 1(0) + 0(1) + 0(0) = 0 and both magnitudes equal 1. Evaluating arccos(0) * 180° / pi returns 90°, confirming that the x and y axes meet at a right angle.

Worked example 1 showing orthogonal vectors (1,0,0) and (0,1,0) at 90 degrees
Perpendicular x and y basis vectors meeting at 90 degrees.

3D Cube Face Diagonals: (1, 1, 0) and (1, 0, 1)

Two face diagonals drawn from the same corner of a cube have coordinates a = (1, 1, 0) and b = (1, 0, 1). Their dot product is 1(1) + 1(0) + 0(1) = 1, and each vector has length sqrt(1^2 + 1^2 + 0^2) = sqrt(2). The cosine is 1 / (sqrt(2) * sqrt(2)) = 0.5, so the calculator outputs 60°.

Worked example 2 showing 3D cube face diagonals (1,1,0) and (1,0,1) at 60 degrees
Two face diagonals of a 3D cube forming a 60-degree interior angle.

Obtuse 3D Force Vectors: (1, 2, 2) and (-2, 1, -2)

Two tug cables pull on a mooring ring along a = (1, 2, 2) and b = (-2, 1, -2). Their magnitudes are sqrt(1+4+4) = 3 and sqrt(4+1+4) = 3, while their dot product is 1(-2) + 2(1) + 2(-2) = -4. Because cos(theta) = -4 / 9 = -0.444444, the calculator returns the obtuse angle 116.387799961°.

Worked example 3 showing 3D force vectors (1,2,2) and (-2,1,-2) at 116.387799961 degrees
Two 3D cable force vectors pulling at an obtuse 116.39-degree angle.

How to Read and Verify the Vector Angle Output

The output displays the non-reflex interior angle theta in degrees (°) on the closed interval [0°, 180°]. Regardless of how the two vectors are oriented in 3D space, the angle is measured in the unique plane spanned by a and b when placed tail to tail.

Sign check via dot product xu + yv + zw: A positive scalar dot product (a . b > 0) places the angle in the acute regime (0° <= theta < 90°), reaching 0° when the vectors point along the same ray. A vanishing dot product (a . b = 0) confirms an exact 90° orthogonal boundary, whereas a negative dot product (a . b < 0) places the angle in the obtuse regime (90° < theta <= 180°), reaching 180° for opposite rays.

Single-vector axis angle shortcut: If you need the direction angle of a single vector a = (x, y, z) with respect to the positive x, y, or z axis, enter (1, 0, 0), (0, 1, 0), or (0, 0, 1) as the second vector, or compute all three axis angles simultaneously in the Vector Direction Cosines Calculator.

Diagram comparing acute, right, and obtuse vector angles by dot product sign
Chart showing acute (0 to 90 degrees, dot product > 0), right (90 degrees, dot product = 0), and obtuse (90 to 180 degrees, dot product < 0) vector angles.

Scope Limits, Validation Rules & Related Vector Calculators

Review these operational boundaries before using the output in engineering or graphics pipelines:

Non-zero vector requirement and unsigned interval: Both a and b must have at least one non-zero coordinate; entering (0, 0, 0) triggers the validation error 'Both vectors must be nonzero.' The arccosine formula returns the shortest unsigned angle in [0°, 180°]. If you need a signed 2D rotation direction, check the sign of the z-component (x*v - y*u) in the Cross Product Calculator.

Inspect the numerator and denominator separately in the Dot Product Calculator and Vector Magnitude Calculator, compute all three axis angles in the Vector Direction Cosines Calculator, normalize a vector in the Vector Normalizer, project one vector onto another in the Vector Projection Calculator, or convert degrees to radians in the Angle Converter.

Related vector and angle calculators linked from the Vector Angle Calculator
Workflow diagram linking the Vector Angle Calculator to Dot Product, Vector Magnitude, Direction Cosines, Cross Product, and Angle Converter.

Frequently Asked Questions About Vector Angle Calculator

Answers about using Vector Angle Calculator and understanding its results.

How do you calculate the angle between two 2D or 3D vectors?

Multiply matching coordinates and add them to get the dot product a . b = xu + yv + zw, then find the lengths ||a|| and ||b|| using the Pythagorean theorem. Divide the dot product by the product of those two lengths and apply the inverse cosine (theta = arccos((a . b) / (||a|| * ||b||))). For 2D vectors, keep both z inputs at 0.

What does an acute, 90-degree, or obtuse angle tell you about the dot product?

Because ||a|| and ||b|| are always positive, the sign of cos(theta) matches the sign of the dot product a . b. An acute angle (0° <= theta < 90°) means a . b > 0, a 90° angle means the vectors are perpendicular (a . b = 0), and an obtuse angle (90° < theta <= 180°) means a . b < 0.

Do you need to normalize vectors before calculating the angle between them?

No. You can enter raw unnormalized coordinates directly into the form. Internally, the calculator computes each vector's length via Math.hypot and divides each coordinate by its vector magnitude during the cosine step, so scaling either vector by a positive constant leaves the resulting angle unchanged.

Why can't you calculate the angle when one vector is (0, 0, 0)?

The zero vector (0, 0, 0) is a single point with magnitude ||0|| = 0 and no spatial direction. Substituting ||a|| = 0 or ||b|| = 0 into (a . b) / (||a|| * ||b||) causes division by zero (0/0), so the calculator stops and displays 'Both vectors must be nonzero.'

How do I convert the degree output from the vector angle calculator into radians?

To convert any angle theta from degrees to radians, multiply the degree value by pi / 180 (approximately 0.01745329252). For example, 60° equals pi / 3 (about 1.0471975512 rad), and 90° equals pi / 2 (about 1.5707963268 rad). You can also paste the number into our Angle Converter.

Calculate with your input

Choose another tool for your next calculation, conversion, or text task.

Calculate