POV-Ray : Newsgroups : povray.unofficial.patches : Step function : Re: Step function Server Time
15 May 2024 04:44:51 EDT (-0400)
  Re: Step function  
From: Libellule
Date: 23 Aug 2000 00:19:42
Message: <39A3511E.6AC3CF43@insectes.net>
> You don't need a macro for this, a plain old function will do fine.
>
> #declare Heaviside = function {if(x - y, 1, 0)}
> // x=the value, y=the jump threshold, z=nothing

I was wondering about the macro, that would make it more general, but,
as has been demonstrated, they cannot be used inside functions :-)

Thanks to all, I got exactly what I needed, one-stop shopping :-))


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.