Ray Yates
: mivascript at, pcinet d0t com
02/09/2012 12:07 a.m.
02/09/2012 12:07 a.m.
A bug in acos(x) causes it to return cos(x). This is true through version 5.14. The derivitive function below was provided by Jon Burchmore and returns the correct value.
<MvFUNCTIONNAME="arccos"PARAMETERS="val"STANDARDOUTPUTLEVEL=""><MvASSIGNNAME="l.negval"VALUE="{ 0 - l.val }>"<MvFUNCTIONRETURNVALUE="{ atan( l.negval / sqrt( l.negval * l.val + 1 ) ) + 2 * atan( 1 ) }>"</MvFUNCTION>