MATLAB Answers

0

When using polarplot, why does the argument come before the modulus?

Max Allen 님이 질문을 제출함. 19 Oct 2019
최근 활동 Steven Lord 님이 답변함. 20 Oct 2019
I thought the convention for polar coordinates was (r,theta), not (theta, r)?
Is there a reason for this, or was this question a waste of space?

  댓글 수: 0

로그인 to comment.

답변 수: 2

John D'Errico 님의 답변 19 Oct 2019
 채택된 답변

There is no officiially agreed convention, nor can there really be one. Don't expect the author to have used the same conventions that you personally like to use. Any "convention" like this is purely based on personal perference and who you learned it from. Someone from a different country or background can easily think differently, and they would be just as validly correct as you.
Should it be (r,theta) or (theta,r)? Make sure that you know which was used. Make sure that you know if the software uses radians or degrees for the angle.
When using ANY software, read the help. If you don't, then expect to get random results.

  댓글 수: 0

로그인 to comment.


Steven Lord 님의 답변 20 Oct 2019

The polarplot function is using the same convention as the older polar function, with theta as the first input argument and rho the second. I'm not completely certain why polar uses that ordering (that function was introduced before I joined MathWorks) but if I had to guess I'd guess it was for similarity to plot.
The plot function accepts x and y coordinates and plots (effectively) y = f(x).
The polar function accepts theta and rho coordinates and plots (effectively) rho = f(theta).
The polarplot function accepts theta and rho coordinates and plots (effectively) rho = f(theta).

  댓글 수: 0

로그인 to comment.



Translated by