Angle Between Two Vectors Calculator
Our free angles calculator solves angle between two vectors problems. Get worked examples, visual aids, and downloadable results.
Reviewed for accuracy by Manoj Kumar, Mathematics Educator
Angle Between Two Vectors Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: theta = arccos((A dot B) / (|A| * |B|))
Worked example โ The vectors are perpendicular (orthogonal). Angle = 90 degrees.
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 |A| = sqrt(9 + 16) = sqrt(25) = 5 |B| = sqrt(16 + 9) = sqrt(25) = 5 cos(theta) = 0 / (5 * 5) = 0 theta = 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 |A| = sqrt(1 + 4 + 9) = sqrt(14) = 3.7417 |B| = sqrt(16 + 25 + 36) = sqrt(77) = 8.7749 cos(theta) = 32 / (3.7417 * 8.7749) = 32 / 32.833 = 0.9747 theta = 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 dot product and what does it tell us geometrically?
The dot product (also called scalar product or inner product) of two vectors produces a single number that encodes information about the angle between them and their magnitudes. Geometrically, A dot B = |A| * |B| * cos(theta), meaning it equals the product of magnitudes times the cosine of the angle between them. A positive dot product means the angle is less than 90 degrees (vectors point in similar directions). A negative dot product means the angle exceeds 90 degrees (vectors point in opposing directions). A zero dot product means the vectors are perpendicular (orthogonal). The dot product also equals the length of the projection of one vector onto the other, multiplied by the other vector magnitude.
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.
How do you find the projection of one vector onto another?
The scalar projection of vector A onto vector B equals (A dot B) / |B|, which gives the length of the shadow A casts onto the line defined by B. The vector projection is this scalar times the unit vector in the B direction: proj_B(A) = ((A dot B) / |B|^2) * B. If the scalar projection is positive, A has a component pointing in the same direction as B. If negative, it points in the opposite direction. Vector projection is used extensively in physics to decompose forces into components, in computer graphics for shadow calculations, in navigation for finding how far along a path you have traveled, and in machine learning for projecting data onto principal components.
What is a unit vector and why is it important?
A unit vector is a vector with magnitude exactly equal to 1. It is created by dividing each component of a vector by its magnitude: unit(A) = A / |A|. Unit vectors preserve direction but normalize the length, making them ideal for representing pure directions without magnitude information. The standard unit vectors i = (1,0,0), j = (0,1,0), and k = (0,0,1) form the basis of the Cartesian coordinate system. Unit vectors are essential in physics for specifying force directions, in computer graphics for surface normals and lighting calculations, and in navigation for heading directions. Any vector can be expressed as its magnitude times its unit vector.
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.
How are vector angles used in computer graphics and game development?
Vector angles are fundamental to 3D rendering and game physics. In lighting, the angle between the surface normal vector and the light direction vector determines surface brightness using Lambert cosine law: intensity is proportional to the cosine of the angle. In collision detection, the angle between a movement vector and a surface normal determines reflection angles and bounce behavior. Field-of-view calculations use vector angles to determine whether objects are within a camera frustum. Character AI uses the angle between the facing direction and target direction to determine turning behavior. Dot products are preferred over computing actual angles because they avoid expensive trigonometric function calls.
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 are vector operations used in physics and engineering applications?
Vector operations are the language of physics and engineering. Force decomposition uses projections to split forces into components along different axes. Work is calculated as the dot product of force and displacement vectors, meaning only the component of force along the direction of movement does work. Torque is the cross product of the position vector and force vector, measuring rotational tendency. In electrical engineering, the angle between voltage and current phasors determines power factor. In structural engineering, the angle between load vectors and support vectors determines stress distribution. Fluid dynamics uses vector field operations extensively for modeling flow patterns and computing circulation.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator ยท Editorial policy
Related Calculators
๐งฎAngle Between Lines Calculator
Calculate angle between lines with inputs, formulas, and instant results.
๐งฎDistance Between Points Calculator
Calculate the distance between two points in 2D, 3D, or N-dimensional space.
๐งฎCoordinate Distance Calculator
Calculate distance between two points using the distance formula with step-by-step work.
๐งฎPyramid Angle Calculator
Calculate pyramid angle with inputs, formulas, and instant results.
๐งฎCentral Angle Calculator
Calculate central angle with inputs, formulas, and instant results.
๐งฎClock Angle Calculator
Calculate clock angle with inputs, formulas, and instant results.
๐งฎCoterminal Angle Calculator
Calculate coterminal angle with inputs, formulas, and instant results.
๐งฎReference Angle Calculator
Calculate reference angle with inputs, formulas, and instant results.