|
|
Le 17/04/2017 à 21:05, Bald Eagle a écrit :
> Mike Horvath <mik### [at] gmailcom> wrote:
>
>> Make sure you are using radians and degrees properly. You may have to
>> convert between the two.
>
> Well, the thing is, when I do it all in SDL, it works out fine.
>
> I send the value of angle out to the debug stream, and it's the expected 68.3
> degrees or whatever.
>
> Then I work it all out step by step in Excel, and it's just looking WAY off.
> See my rows labeled radians and degrees.
> I'm using degrees = (radians /pi)*180, and it gives me the same result as
> Excel's degrees() function. So I'm wondering if the atan2 function is flawed.
>
>
>
>
Beware, atan2 is not always taking parameters in same order.
In Povray SDL, atan2(A,B) gives the angle in radians of tangent (A/B).
In C (man page), atan2(y,x) gives the angle in radians of tangent (y/x)
In Excel, atan2(x_num,y_num) ... yes, they swapped the parameters !
Post a reply to this message
|
|