MyCalCute
Install
Calculators / Math / Angle between vectors

Angle between vectors calculator

Find the smaller angle between two nonzero three-dimensional vectors.

On this page

Your result

Angle12.93degrees

Calculator controls

How to calculate

Find the smaller angle between two nonzero three-dimensional vectors.

Angle = acos((((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))-1+abs((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))+1))/2+1-abs(((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))-1+abs((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))+1))/2-1))/2)*180/pi degrees

Worked example

Vector A x: 1; Vector A y: 2; Vector A z: 3; Vector B x: 4; Vector B y: 5; Vector B z: 6.

Angle: 12.93 degrees.

Assumptions and limits

The angle is between zero and 180 degrees. Both vectors must be nonzero; the dot-product cosine is limited at both rounding boundaries.

Results are rounded for display; calculations use unrounded values. Read our calculation methodology.

Understanding the result

Find the smaller angle between two nonzero three-dimensional vectors.

When this tool is useful

Angle = acos((((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))-1+abs((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))+1))/2+1-abs(((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))-1+abs((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))+1))/2-1))/2)*180/pi degrees

Understanding your inputs

InputWhat to enter
Vector A xEnter a number of at least -1000000000000 and no more than 1000000000000.
Vector A yEnter a number of at least -1000000000000 and no more than 1000000000000.
Vector A zEnter a number of at least -1000000000000 and no more than 1000000000000.
Vector B xEnter a number of at least -1000000000000 and no more than 1000000000000.
Vector B yEnter a number of at least -1000000000000 and no more than 1000000000000.
Vector B zEnter a number of at least -1000000000000 and no more than 1000000000000.

Frequently asked questions

What assumptions does this calculation use?

The angle is between zero and 180 degrees. Both vectors must be nonzero; the dot-product cosine is limited at both rounding boundaries.

How is the result calculated?

Angle = acos((((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))-1+abs((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))+1))/2+1-abs(((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))-1+abs((ax*bx+ay*by+az*bz)/sqrt((ax^2+ay^2+az^2)*(bx^2+by^2+bz^2))+1))/2-1))/2)*180/pi degrees