필터 지우기
필터 지우기

I do not get exactly what does atan2d(0,0) means?

조회 수: 2 (최근 30일)
Navid
Navid 2013년 12월 10일
편집: Matt J 2013년 12월 10일
I know what does "atan2d" do, but why atan2d(0,0) give us zero? shouldn't it be NaN?

채택된 답변

Matt J
Matt J 2013년 12월 10일
편집: Matt J 2013년 12월 10일
I think the reasoning is this,
t=atan2d(y,x)
should satisfy
norm([x,y])*cosd(t)=x
norm([x,y])*sind(t)=y
In the case where x=y=0, any t would satisfy this, but the convention t=0 ensures continuity of atan2d(y,x) over x>=0.
  댓글 수: 2
Navid
Navid 2013년 12월 10일
Matt,
Thank you for your answer and it was a good discussion, but I am not satisfied yet.
If we choose t=pi/2, it will give us continuity over y>=0!!! in fact as you said, any t would satisfy it and we can say that it has singularity at x=y=0. So I believe that it should be NaN.
Matt J
Matt J 2013년 12월 10일
편집: Matt J 2013년 12월 10일
Hi Navid,
If we choose t=pi/2, it will give us continuity over y greater than or equal 0
That is true. It is something of an arbitrary choice, I imagine, but less arbitrary than, say t=pi/sqrt(3).
in fact as you said, any t would satisfy it and we can say that it has singularity at x=y=0. So I believe that it should be NaN.
We can only guess the minds of the software developers. I don't think it could precisely be called a singularity, though, because there exist real values that satisfy the defining equations, if you're willing to accept
norm([x,y])*cosd(t)=x
norm([x,y])*sind(t)=y
as that definition.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Matt J
Matt J 2013년 12월 10일
편집: Matt J 2013년 12월 10일
As further motivation, consider also the similar convention used by the angle() function
>> angle(0+0i)
ans =
0
In Fourier Analysis, this makes sense because, even though Fourier spectra are in general complex-valued, there are prominent cases where a spectrum S(f) is real-valued and you want the phase response to be semi-continuous at zero crossings S(f)=0.

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by