Skip to main content

Angle Between Two Vectors Calculator

Our free angles calculator solves angle between two vectors problems. Get worked examples, visual aids, and downloadable results.

Share this calculator

Formula

theta = arccos((A dot B) / (|A| * |B|))

The angle between two vectors equals the inverse cosine of the dot product divided by the product of their magnitudes. The dot product A dot B = Ax*Bx + Ay*By + Az*Bz, and the magnitude |A| = sqrt(Ax^2 + Ay^2 + Az^2). The result is always between 0 and 180 degrees.

Worked Examples

Example 1: Angle Between 2D Vectors

Problem: Find the angle between A = (3, 4) and B = (4, -3).

Solution: A dot B = (3)(4) + (4)(-3) = 12 - 12 = 0\n|A| = sqrt(9 + 16) = sqrt(25) = 5\n|B| = sqrt(16 + 9) = sqrt(25) = 5\ncos(theta) = 0 / (5 * 5) = 0\ntheta = arccos(0) = 90 degrees

Result: The vectors are perpendicular (orthogonal). Angle = 90 degrees.

Example 2: 3D Vector Angle with Cross Product

Problem: Find the angle between A = (1, 2, 3) and B = (4, 5, 6).

Solution: A dot B = 1(4) + 2(5) + 3(6) = 4 + 10 + 18 = 32\n|A| = sqrt(1 + 4 + 9) = sqrt(14) = 3.7417\n|B| = sqrt(16 + 25 + 36) = sqrt(77) = 8.7749\ncos(theta) = 32 / (3.7417 * 8.7749) = 32 / 32.833 = 0.9747\ntheta = arccos(0.9747) = 12.93 degrees

Result: Angle = 12.93 degrees. The vectors point in similar directions (small angle, large positive dot product).

Frequently Asked Questions

How do you find the angle between two vectors using the dot product?

The angle between two vectors is found using the dot product formula: cos(theta) = (A dot B) / (|A| * |B|). First, compute the dot product by multiplying corresponding components and summing: A dot B = Ax*Bx + Ay*By + Az*Bz. Then compute each vector magnitude as the square root of the sum of squared components. Divide the dot product by the product of magnitudes and take the inverse cosine (arccos) to get the angle. The result is always between 0 and 180 degrees (0 and pi radians). This formula works in any number of dimensions and is the standard method used in physics, computer graphics, and engineering.

What is the cross product and how does it relate to the angle between vectors?

The cross product of two vectors A and B produces a new vector perpendicular to both A and B. Its magnitude equals |A| * |B| * sin(theta), where theta is the angle between the vectors. The cross product only exists in three dimensions (and seven dimensions, but that is rarely used). The direction follows the right-hand rule: if you curl your right hand fingers from A toward B, your thumb points in the cross product direction. The cross product is zero when vectors are parallel (sin(0) = 0) and maximum when they are perpendicular (sin(90) = 1). It is essential in physics for computing torque, magnetic force, and angular momentum.

What does it mean when two vectors are orthogonal?

Two vectors are orthogonal (perpendicular) when the angle between them is exactly 90 degrees, which means their dot product equals zero. Orthogonality is a fundamental concept in linear algebra and has wide-ranging applications. In coordinate systems, the standard basis vectors (i, j, k) are mutually orthogonal, which makes calculations simpler. In signal processing, orthogonal signals do not interfere with each other. In statistics, orthogonal variables are uncorrelated. In machine learning, orthogonal features provide independent information. Testing for orthogonality is as simple as computing the dot product and checking whether it equals zero.

Can the angle between two vectors be greater than 180 degrees?

No, the angle between two vectors as defined by the dot product formula is always between 0 and 180 degrees (0 to pi radians). This is because arccos returns values only in the range [0, pi]. The concept of a signed angle or reflex angle (greater than 180 degrees) requires additional information such as a reference direction or orientation. In 2D, you can compute a signed angle using the atan2 function with the cross product z-component and dot product, which gives results from -180 to 180 degrees. In 3D, there is no natural way to define a signed angle without specifying a reference plane or normal vector to determine the sign convention.

What is the difference between 2D and 3D vector angle calculations?

In 2D, vectors have two components (x, y) and the dot product formula gives the unsigned angle between them. You can also use atan2(cross, dot) to get a signed angle indicating clockwise or counterclockwise rotation. The 2D cross product (Ax*By - Ay*Bx) gives a scalar whose sign indicates orientation. In 3D, vectors have three components (x, y, z), and the dot product formula works identically to give the unsigned angle. The 3D cross product yields a vector rather than a scalar, and this vector is perpendicular to the plane containing both input vectors. Three-dimensional angle calculations cannot produce a natural signed angle without choosing a reference orientation.

How accurate are the results from Angle Between Two Vectors Calculator?

All calculations use established mathematical formulas and are performed with high-precision arithmetic. Results are accurate to the precision shown. For critical decisions in finance, medicine, or engineering, always verify results with a qualified professional.

References