how can i calculate the angle between a vector and the x axes?
Show older comments
Hi, How can i calculate the angle between a vector and the x axes of my figure? I have been trying to find a function but with no success. I have a 1x2 vector and i would like to know what is the angle between it and the x axes.
Accepted Answer
More Answers (1)
Jan
on 1 Oct 2013
This is the included angle in the range [0, pi]:
v = [rand, rand];
angle = atan2(abs(v(2)), v1)
Perhaps you want an oriented angle from [0, 2*pi] or [-pi, pi]?
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!