Cosine is always between -1 and 1 inclusive, so arccos (which is its inverse) 
is undefined outside that range. Just clamp your inputs, and you should be fine.

gray

From: [email protected] 
[mailto:[email protected]] On Behalf Of jimmy gass
Sent: Thursday, March 21, 2013 03:51 PM
To: [email protected]
Subject: arcCos nan

I'm having issues with arccos returning nan for some values.

Is there a way to filter out the nan and just return 0? It can break renders 
and simulations.

What would cause arccos to return nan, is it like divide by zero? Maybe I can 
do a check of the values before I'm operating on them.

Thanks

jimmy

<<attachment: winmail.dat>>

Reply via email to