Show older comments
atan2から求めたθの値から‐π/2したいのですが、そのまま引くと-πからπの範囲を超えてしまいます。 どうすれば-πからπの範囲で計算することができますか?
Accepted Answer
More Answers (1)
Akira Agata
on 29 Jan 2018
少々手間ですが、MATLABの基本関数を使ったこんな方法でも対応可能です。
% atan2 で求めた theta の値から -pi/2
theta = theta - pi/2;
% [-pi, pi] の範囲に調整
theta = theta - 2*pi*fix(theta/pi);
Categories
Find more on 三角法 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!