Finding theta in [-pi/2,pi/2] instead of [-pi/4,pi/4] using arctan
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Adib Yusof
am 31 Dez. 2018
Bearbeitet: madhan ravi
am 2 Jan. 2019
Hi. I need help on trigonometry.
I have a signal and a formula, which I found in a paper.
![Annotation 2018-12-31 162445.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199957/Annotation%202018-12-31%20162445.jpeg)
I wanna find theta (as in the formula). When using function atan(), my theta ranges from [-pi/4,pi/4]. In the paper, it mentions that theta should range from [-pi/2,pi/2], and we need to take the signs of numerator and denominator of the right-hand side of the formula into consideration when calculating theta.
My question is, how do I convert from [-pi/4,pi/4] to [-pi/2,pi/2] correctly? I know if I were to convert [-pi/2,pi/2] to [-pi,pi], I just have to use atan2() function, but in this case, it's a portion of full circle.
Please help and thank you.
2 Kommentare
Akzeptierte Antwort
madhan ravi
am 31 Dez. 2018
Bearbeitet: madhan ravi
am 2 Jan. 2019
https://www.mathworks.com/help/matlab/ref/atan2.html#buct8h0-4 - it mentions "In contrast, atan(Y/X) returns results that are limited to the interval [-pi/2,pi/2], shown on the right side of the diagram."
tan(2*theta) = ((2*Ah*Ad)/(Ad^2-Ah^2))*cos(thetah-thetad);
2*theta = atan(((2*Ah*Ad)/(Ad^2-Ah^2))*cos(thetah-thetad));
theta = atan(((2*Ah*Ad)/(Ad^2-Ah^2))*cos(thetah-thetad)) / 2 % the result would be in radians
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Types finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!