Hi,
In one of my application i am required to measure phase difference with an accuracy of 0.01degrees.I was using
this chip,& with the help of the atan function available in math.h, i am able to calculate the phase by giving phase(radians)=atan(y/x).
With this the phase value has a range from 0 to 89 & then -89 to 0, but i was having a requirement to get the phase in the range -180 to 180.
So i used atan2 function,when i used it the phase value does change in the range of -180 to 180,but the accuracy level seems to have dropped on comparing with atan with same values y & x as input & since in my requirement the accuracy is an important factor i was looking for a solution to this.
In CCS when i kept the floating point mode as strict,the accuracy increased a little but is not sufficient.
I am currently using compiler version V6.2.11.With v6.2.5 the output value of atan doesn't go beyond 45deg,with V6.2.9 & higher it gives -90 to 90 output with the same y,x values as input.
would like to have some suggestions..