Forums > MaxMSP

Bug? acos giving strange output


dtr
March 17, 2014 | 8:20 am

According to the reference input range is (-1,1) and output (-pi,pi). I’m getting (pi,0) as output range.

Can anyone confirm?

<pre><code>

– Pasted Max Patch, click to expand. –

</code></pre>

 

 

 

 

 


March 17, 2014 | 8:51 am

i think the object is working correct (wrong in reference):

http://reference.wolfram.com/mathematica/ref/ArcCos.html


March 18, 2014 | 1:40 am

If you think for a moment about what acos() is doing, it’s clear that the output range can only be a half cycle (i.e., 180° or π) when working with reals (i.e., not complex values).

Mathematically, there is a certain logic in declaring the range [-π/2 .. π/2]. But the standard digital-arithmetic implementation shifts the range to [0 .. π] (see man acos(3)).

The Max objects for all calculations are simply wrappers around the standard C math libraries, so if in doubt, that’s where to look.



dtr
March 18, 2014 | 2:17 am

"If you think for a moment"

Hehe yes indeed. I might have if my poor brain wasn’t so deadline stressed right now!

So yes, the bug’s in the reference, not the object.


Viewing 4 posts - 1 through 4 (of 4 total)