Value of angle theta
8 views (last 30 days)
Show older comments
I'm trying to find the value of an angle (theta) given the values of cosine (cos(theta)) and sine (sin(theta)). However, when I use the inverse trigonometric functions acosd(cos(theta)) and asind(sin(theta)), I end up with two different values for theta. How should I handle this situation?
0 Comments
Accepted Answer
Samay Sagar
on 26 Jun 2023
This can be happening for negative values of theta since the range of arcsin is [-pi/2,pi2] and that of arccos is [0,pi] . You can try to first calculate tan(theta) and then calculate arctan. Something like this might help:
a = sin(x)
b = cos(y)
c = tan(y)
d = atand(c) % or use atan2d as d = atan2d(sin(x),cos(x))
0 Comments
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!