|
![](/i/fill.gif) |
slehar <sle### [at] gmail com> wrote:
> So it seems you can't do logical tests on the values of the parameters in a
> function either!
Any #-command is SDL. Any SDL-declared identifier is SDL. You can't use
them in functions (except to build the function body).
> #declare densityfunc = function(px,py,pz) {
> #if(px > 0 | py < 0)
> atan2(py,px)
> #else
> pi - atan2(py,px)
> #end
> }
Why would you want to use two versions of atan2(), given that it works
with all possible values of the parameters?
Anyways, the user-defined function syntax has a function called select()
which you can use to test for conditions and select different functions
depending on them.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |