Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate obtuse angle between two vectors?

Tags:

math

How to calculate obtuse angle between two vectors if both vectors and x axis is given. First vector can be taken as x axis. we can get acute by dot product and acos.

like image 298
OliveOne Avatar asked Oct 20 '25 12:10

OliveOne


1 Answers

Before applying acos, check if the dot product is negative. If negative, the angle is obtuse :)

Further, as acos has a range of 0 to pi, you will do fine as long as you do not want reflex angles (>pi)

like image 149
KJ Saxena Avatar answered Oct 22 '25 03:10

KJ Saxena