VOOZH about

URL: https://www.geeksforgeeks.org/maths/how-to-find-the-angle-between-two-vectors/

โ‡ฑ How to Find the Angle Between Two Vectors? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Find the Angle Between Two Vectors?

Last Updated : 23 Jul, 2025

Vector quantities are the physical quantities that have both magnitude and direction and the angle between two vectors can be easily found if the dot product or the cross product of the two vectors is given.

In this article, we will learn how to find the angle between two vectors, its formula, related examples, and others in detail.

How to Find the Angle Between Two Vectors?

Angle between vectors can be found by using two methods:

  • Using Scalar (Dot) Product 
  • Using Cross (Vector) Product

However, the most commonly used formula for finding an angle between two vectors involves the scalar product. 

๐Ÿ‘ Image
Vectors with angle ฮธ between them

Finding Angle using  Scalar (Dot) Product 

Two vectors combined into a scalar product give you a number. Scalar products can be used to define the relationships between energy and work. In mathematics, a scalar product is used to represent the work done by a force (which is a vector) in dispersing (which is a vector) an object. The scalar product is represented by a dot (.). Let,

Dot product be (a.b)

Magnitude of vector a = |a|

Magnitude of vector b = |b|

Angle between the vectors is

ฮธ = Cos-1 [(a ยท b) / (|a| |b|)]

When two vectors are connected by a dot product, the direction of the angle แ€ does not matter. The angle แ€ can be measured by the difference between either vector since Cos แ€ = Cos (-แ€) = Cos (2ฯ€ - แ€).

Finding Angle Using Cross (Vector) Product

A cross product may also be known as a vector product. It is a form of vector multiplication that takes place between two vectors that have different kinds or natures. When two vectors are multiplied with each other and the resulting product is also a vector quantity, the resulting vector is called the cross product of two vectors or the vector product. Multiplication of two vectors yields vector products with a direction perpendicular to each vector. Let,

Cross product be (a ร— b)

Magnitude of vector a = |a|

Magnitude of vector b = |b|

|a ร— b| = |a| |b| sin ฮธ

Angle between the vectors is,

ฮธ = Sin-1 [|a ร— b|  / (|a| |b|)]

People Also Read:

Sample Problems - How to Find the Angle Between Two Vectors?

Problem 1: Find the angle between two vectors a = {4, 5} and b = {5, 4}.

Solution:

Using aโ‹…b = โˆฃaโˆฃโ‹…โˆฃbโˆฃโ‹…cos(ฮธ)

Finding dot product: aโ‹…b = (4โ‹…5) + (5โ‹…4) โ‡’ 40

Magnitude of vectors:

|a| = โˆš(42 + 52 ) = โˆš(16 + 25 )โ‡’ โˆš41

|b| = โˆš(52 + 42 ) = โˆš(25 + 16) โ‡’ โˆš41

cos ฮธ = (aโ‹…b) โˆ• |a|โ‹…|b| โ‡’ 40 โˆ• โˆš41 โ‹…โˆš41 โ‡’ 40 โˆ•41

ฮธ = cos-1 (40โˆ•41) โ‡’ 20.556ยฐ

Problem 2: Find the angle between two vectors a = {2, 2} and b = {1, 1}.

Solution:

Using aโ‹…b = โˆฃaโˆฃโ‹…โˆฃbโˆฃโ‹…cos(ฮธ)

Finding dot product: aโ‹…b = (2 โ‹…1) + (2 โ‹… 1) โ‡’ 4

Magnitude of vectors:

|a| = โˆš(22 + 22)= โˆš(4 + 4) โ‡’ โˆš8

|b| = โˆš(12 + 12 )= โˆš( 1+ 1 )โ‡’ โˆš2

cos ฮธ = (aโ‹…b) โˆ• |a|โ‹…|b| โ‡’ 4 โˆ• โˆš8 โ‹…โˆš2 = 4 โˆ•4 โ‡’ 1

ฮธ = cos-1 (1) โ‡’ 0ยฐ

Problem 3: Find the angle between two vectors a = i + 2j - k and b = 2i + 4j - 2k.

Solution:

Using aโ‹…b = โˆฃaโˆฃโ‹…โˆฃbโˆฃโ‹…cos(ฮธ)

Finding dot product: aโ‹…b = (1โ‹…2) + (2โ‹…4) + ( -1โ‹…-2) = 2+ 8+2 โ‡’12

Magnitude of vectors:

|a| = โˆš(12 + 22 + (-1)2 0= โˆš(1 + 4 + 1 )โ‡’ โˆš6

|b| = โˆš(22 + 42 + (-2)2 ) = โˆš(4+ 16 + 4) โ‡’ โˆš24

cos ฮธ = (aโ‹…b) โˆ• |a|โ‹…|b| โ‡’ 12 โˆ• (โˆš6 โ‹…โˆš24) = 12 โˆ•12 โ‡’ 1

ฮธ = cos-1 (1) โ‡’ 0ยฐ

Problem 4: Find the angle between two vectors a = i + 2j - k and b = 4j - 2k.

Solution:

a = i + 2j - k

b = 0i + 4j - 2k

Using aโ‹…b = โˆฃaโˆฃโ‹…โˆฃbโˆฃโ‹…cos(ฮธ)

Finding dot product: aโ‹…b = (1โ‹…0) + (2โ‹…4) + (โˆ’1โ‹…โˆ’2) = 0+8+2 โ‡’10

Magnitude of vectors:

|a| = โˆš(12 + 22 + (-1)2 0 = โˆš( 1 + 4 + 1 )โ‡’ โˆš6

|b| = โˆš(02 + 42 + (-2)2 ) = โˆš(16 + 4) โ‡’ โˆš20

cos ฮธ = (aโ‹…b) โˆ• |a|โ‹…|b| = 10 โˆ• (โˆš6โ‹…โˆš20) = 10/โˆš120 โ‡’ 5 โˆ• โˆš30

ฮธ = cos-1 (5 โˆ• โˆš30) โ‡’ 45ยฐ

Problem 5: Find the angle between two vectors a = {1, -3} and b = {-3, 1}.

Solution:

Using aโ‹…b = โˆฃaโˆฃโ‹…โˆฃbโˆฃโ‹…cos(ฮธ)

Finding dot product: aโ‹…b = (1 โ‹…-3) + (-3 โ‹… 1) = -3 -3 โ‡’ -6

Magnitude of vectors:

|a| = โˆš(12 + (-3)2 = โˆš(1 + 9 )โ‡’ โˆš10

|b| = โˆš(-3)2 + 12) = โˆš(9 + 1) โ‡’ โˆš10

cos ฮธ = (aโ‹…b) โˆ• |a|โ‹…|b| โ‡’ -6 โˆ• (โˆš10 โ‹…โˆš10) = -6 โˆ•10 โ‡’ -3/5

ฮธ = cos-1 (-3/5) โ‡’ 126.87ยฐ

Problem 6: Find the angle between two vectors a = -3i + j and b = -3i + j.

Solution:

Using aโ‹…b = โˆฃaโˆฃโ‹…โˆฃbโˆฃโ‹…cos(ฮธ)

Finding dot product: aโ‹…b = (-3 โ‹…-3 ) + (1 โ‹… 1) = 9 + 1 โ‡’10

Magnitude of vectors:

|a| = โˆš(-3)2 + 12 = โˆš(9 + 1 ) โ‡’ โˆš10

|b| = โˆš(-3)2 + 12 = โˆš(9 + 1 ) โ‡’ โˆš10

cos ฮธ = (aโ‹…b) โˆ• |a|โ‹…|b| โ‡’ 10 โˆ• (โˆš10 โ‹…โˆš10) = 10 โˆ•10 โ‡’ 1

ฮธ = cos-1 (1) โ‡’ 0ยฐ

Comment

Explore