Hello,
I'm trying to adapt an Excel spreadsheet in POV. I've got a strange problem.
In Excel
Cell E19 = 280.8191102;
Cell E20 = 23.43825611;
Cell E21 = DEGRES ( ATAN2 ( COS(RADIANS(E19));
COS(RADIANS(E20))*SIN(RADIANS(E19) ) ) )
E21 = -78.23396726
In POV
#declare E19 = 280.8191102;
#declare E20 = 23.43825611;
#declare RESULT =degrees(atan2(cos(radians(E19)),
cos(radians(E20))*sin(radians(E19))));
RESULT = 168.233967
No obvious relationship between this -78.2 and +168.2
How to explain this difference ?
Especially since the correct value is -78.2 or 281.7 !
(Note that the numbers after the decimal point are exactly the same.)
Are the origins of angles and rotation direction in Excel and POV
different ?
help apprecied
--
Kurtz le pirate
Compagnie de la Banquise
kurtz le pirate <kur### [at] gmailcom> wrote:
> Hello,>> I'm trying to adapt an Excel spreadsheet in POV. I've got a strange problem.
Are you trying to do atan2 like sane people do?
Because the jackasses at Microsoft reversed the arguments.
https://news.povray.org/povray.binaries.images/message/%3C58f61085%40news.povray.org%3E/#%3C58f61085%40news.povray.org%
3E
-BW
"Bald Eagle" <cre### [at] netscapenet> wrote:
> kurtz le pirate <kur### [at] gmailcom> wrote:> > Hello,> >> > I'm trying to adapt an Excel spreadsheet in POV. I've got a strange problem.>> Are you trying to do atan2 like sane people do?> Because the jackasses at Microsoft reversed the arguments.>>
https://news.povray.org/povray.binaries.images/message/%3C58f61085%40news.povray.org%3E/#%3C58f61085%40news.povray.or
g%
> 3E>> -BW
Hi BE,
we had a similar problem a while ago with the tube-kind-of-thing:
'the atan2 mystery' and you found the right track.
But see what Povray 3.7 documentation uses:
<< 3.3.1.5.4 Functions
atan2(A,B)
Arc-tangent of (A/B). Returns the angle, measured in radians, whose tangent is
(A/B)....>>
So in your words and accepted by the rest of the world - except Microsoft - it
should read atan2(B,A).
It's always good to have you around.
-Droj
_
| )
| |
| |_____
/ (]__)
/ (]___)
/ (]___)
___(]_)
/
/
Thanks a lot guys !
Reading the docs we don't pay enough attention to these kinds of details
but it's really jackasses of Microsoft to reverse the arguments.
Microsoft always faithful to its stupidity...
--
Kurtz le pirate
Compagnie de la Banquise