POV-Ray : Newsgroups : povray.general : A macro that drops a vector-- what's the syntax again? : Re: A macro that drops a vector-- what's the syntax again? Server Time
1 Aug 2024 10:14:46 EDT (-0400)
  Re: A macro that drops a vector-- what's the syntax again?  
From: Slime
Date: 10 Nov 2005 00:36:05
Message: <4372dc45@news.povray.org>
> #macro sign(a)
> #if (a<0)
>         (-a)
> #else
>         (a)
> #end
> #end

#macro sign(a)
    #if (a < 0)
        #local Ans = -a;
    #else
        #local Ans = a;
    #end
    (Ans)
#end

A similar solution for your other macro.

(Though isn't there a sign function or something like that already?)

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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