The Angle Between Vectors Calculator finds the angle separating two 2D or 3D vectors using the dot product formula. Returns the angle in degrees and radians, confirms whether vectors are perpendicular or parallel — essential for physics, engineering, computer graphics, and linear algebra.
1
1
1.414214
0.707107
0.785398
rad
1
1
1.414214
0.707107
0.785398
rad
The calculator for the angle between vectors determines the geometric angle separating two vectors in 2D or 3D space using the dot product relationship. This calculation appears throughout physics (work, torque, field projections), engineering (force analysis), computer graphics (lighting calculations, collision detection), and linear algebra (orthogonality testing, projection).
The angle θ between vectors a and b is related to their dot product by:
cos(θ) = (a · b) / (|a| × |b|) → θ = arccos[(a · b) / (|a| × |b|)]
Where the dot product a · b = a₁b₁ + a₂b₂ + a₃b₃ and the magnitudes |a| = √(a₁² + a₂² + a₃²). This formula always returns an angle between 0° and 180°. For vectors a = (3, 4, 0) and b = (1, 0, 0): a · b = 3; |a| = 5; |b| = 1; cos(θ) = 0.6; θ = 53.13°. Use this online calculator for any vector pair in any dimension.
The dot product immediately reveals special geometric relationships:
Testing orthogonality by dot product is computationally efficient and the standard approach in computer graphics and numerical linear algebra for verifying that coordinate system axes remain perpendicular after rotations and transformations. The matrix multiplication calculator provides the matrix operations context in which vector dot products appear.
The angle between vectors is the core of several fundamental physics calculations:
The matrix determinant calculator computes the cross product magnitude related to sin(θ) for torque and area vector calculations. The linear algebra calculators provide the complete toolkit for vector and matrix operations.
3D graphics engines use the angle between vectors extensively. Lambertian diffuse lighting: surface brightness is proportional to cos(θ) between the surface normal and light direction vector — surfaces facing the light appear bright, edge-on surfaces appear dark. Specular reflection requires the angle between the view vector and reflected light vector. Collision detection uses dot products to determine whether objects are approaching or separating. These applications make the dot product one of the most frequently computed operations in real-time 3D rendering.
The angle is computed from the dot product formula:
$$\cos \theta = \frac{\mathbf{A} \cdot \mathbf{B}}{|\mathbf{A}|\,|\mathbf{B}|} = \frac{x_1 x_2 + y_1 y_2 + z_1 z_2}{\sqrt{x_1^2 + y_1^2 + z_1^2}\;\sqrt{x_2^2 + y_2^2 + z_2^2}}$$
Then:
$$\theta = \arccos\left(\frac{\mathbf{A} \cdot \mathbf{B}}{|\mathbf{A}|\,|\mathbf{B}|}\right)$$
The result is in radians, converted to degrees by multiplying by 180/π. The cosine value is clamped to [−1, 1] to handle floating-point edge cases. The orthogonality check tests whether |A · B| < 0.0001.
The angle in degrees ranges from 0° to 180°. Values near 0° indicate nearly parallel vectors; near 90° indicates nearly perpendicular; near 180° indicates nearly opposite. The cosine ranges from −1 to 1: positive for acute angles, zero for right angles, negative for obtuse. The orthogonal indicator shows 1 if the vectors are perpendicular (within tolerance) and 0 otherwise. The dot product is provided for reference.
Inputs
Results
A · B = 1. |A| = 1, |B| = √2. cos θ = 1/√2 ≈ 0.7071. θ = arccos(1/√2) = 45° = π/4 radians.
Inputs
Results
A · B = −9 − 16 = −25. |A| = |B| = 5. cos θ = −25/25 = −1. θ = arccos(−1) = 180°. The vectors are anti-parallel (point in exactly opposite directions).
No. The angle between two vectors is defined to be in the range [0°, 180°]. The arccos function always returns values in this range. If you need a signed angle (−180° to 180°), you need additional information such as a reference plane or normal vector to define the sign convention.
The angle is undefined when either vector is the zero vector, because the zero vector has no direction. The calculator returns 0° in this case to avoid errors, but the result has no geometric meaning. Always ensure your vectors are nonzero for meaningful angle calculations.
Two vectors are perpendicular (orthogonal) when their dot product is zero, which corresponds to an angle of exactly 90°. The calculator checks this condition using a tolerance of 0.0001 to handle floating-point imprecision and displays the result in the orthogonality indicator.
The arccos formula gives the unsigned angle between 0° and 180°. The atan2 function gives a signed angle between −180° and 180° but is typically used for 2D vectors relative to the x-axis. For the angle between two arbitrary 3D vectors, the arccos-based formula is the standard approach.
For very small angles (vectors nearly parallel), the arccos function can lose precision because cos θ ≈ 1 and the derivative of arccos approaches infinity. For higher precision with small angles, one can use the formula θ = 2 arcsin(|A−B|/2) with normalized vectors. For most practical applications, the standard formula is sufficiently accurate.
No. The angle between A and B is the same as the angle between B and A. This is because the dot product is commutative (A · B = B · A) and the cosine function is even (cos θ = cos(−θ)).
How helpful was this calculator?
5.0/5 (1 rating)