Rotating polar coordinates 180 degrees
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi all,
I have a series of polar coordinates (ranging from -180 - 180 degrees), some of these coordinates are reflected in the wrong direction (by 180 degrees) due to a sampling issue. I need to rotate these back to their correct angle but I'm not sure what the correct mathematical process is, i.e. I can't just add 180 degrees because then some values might come out greater than 180.
Any help would be fabulous!
Rod.
댓글 수: 0
답변 (2개)
Star Strider
2015년 2월 1일
I don’t completely understand the problem, but when you say ‘reflected’, wouldn’t simply negating the angles do what you want?
F’rinstance:
theta_refl = [-180:10:180]; % ‘Reflected’ Angles
theta_true = -theta_refl; % ‘True’ Angles
댓글 수: 0
David Young
2015년 2월 1일
If you want to ensure that all angles are in the range -180 to 180, you can do this:
theta_true = mod(theta_refl, 360) - 180;
which adds 180 to the angles, reversing their direction, then subtracts 360 from any that are over 180 so that they are in the required numerical range.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!