이전 댓글 표시
atan2から求めたθの値から‐π/2したいのですが、そのまま引くと-πからπの範囲を超えてしまいます。 どうすれば-πからπの範囲で計算することができますか?
채택된 답변
추가 답변 (1개)
Akira Agata
2018년 1월 29일
少々手間ですが、MATLABの基本関数を使ったこんな方法でも対応可能です。
% atan2 で求めた theta の値から -pi/2
theta = theta - pi/2;
% [-pi, pi] の範囲に調整
theta = theta - 2*pi*fix(theta/pi);
카테고리
도움말 센터 및 File Exchange에서 三角法에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!