[RESOLED] Possible bugs fx trig functions
Posted: 2018-04-19T17:58:31-07:00
It would seem that in IM 6.9.9.40 and 7.0.7.28 (Mac OSX Sierra) that arcsin and arccos are reversed.
y=0
convert xc: -format "%[fx:acos(y)]\n" info:
0
convert xc: -format "%[fx:asin(y)]\n" info:
1.5708 = pi/2
y=0
magick xc: -format "%[fx:acos(y)]\n" info:
0
magick xc: -format "%[fx:asin(y)]\n" info:
1.5708 = pi/2
But properly arcos(0) is pi/2 and arcsin(0) is 0
See wikipedia graphs at https://en.wikipedia.org/wiki/Inverse_t ... _functions
The above is also obvious since we know that sin(0)=0, so arcsin(0) = 0. And we know that cos(pi/2)=0, so that arccos(0)=pi/2
Checking: the sin(0) should be 0 and the cos(0) should be 1. But in fx, I get
y=0
convert xc: -format "%[fx:sin(y)]\n" info:
0.841471
convert xc: -format "%[fx:cos(y)]\n" info:
0.540302
which are nonsense values.. Likewise for IM 7 with magick.
y=0
convert xc: -format "%[fx:acos(y)]\n" info:
0
convert xc: -format "%[fx:asin(y)]\n" info:
1.5708 = pi/2
y=0
magick xc: -format "%[fx:acos(y)]\n" info:
0
magick xc: -format "%[fx:asin(y)]\n" info:
1.5708 = pi/2
But properly arcos(0) is pi/2 and arcsin(0) is 0
See wikipedia graphs at https://en.wikipedia.org/wiki/Inverse_t ... _functions
The above is also obvious since we know that sin(0)=0, so arcsin(0) = 0. And we know that cos(pi/2)=0, so that arccos(0)=pi/2
Checking: the sin(0) should be 0 and the cos(0) should be 1. But in fx, I get
y=0
convert xc: -format "%[fx:sin(y)]\n" info:
0.841471
convert xc: -format "%[fx:cos(y)]\n" info:
0.540302
which are nonsense values.. Likewise for IM 7 with magick.