POV-Ray : Newsgroups : povray.general : Fitting a gothic trefoil into an equilateral triangle : Re: Fitting a gothic trefoil into an equilateral triangle Server Time
4 Aug 2024 14:25:42 EDT (-0400)
  Re: Fitting a gothic trefoil into an equilateral triangle  
From:
Date: 3 Aug 2003 19:14:41
Message: <3f2d9761$1@news.povray.org>
Hi David,

a gothic trefoil is basically an equilateral triangle with circles
inscribed into the corners that meet in the triangle's midpoint.
Mark (aka LibraryMan aka LinuxLibrarian) asked for the construction
of these circles (thread started 12 June 2003). I described this
to him, so *I* know about incircles and all the other stuff :-)

In your macros you always create a variable to return the result --
this is not neccessary, simply return the expression that gives
the result. Enclose this expression in parentheses if neccessary
to avoid unwanted precedences. For example your

  #macro Pythag(a,b)
   #local py = sqrt(a*a+b*b);
   py
   #end

might be rewritten as

  #macro Pythag(a,b)
    sqrt(a*a+b*b)
    #end

Here parentheses are required:

  #macro Successor(N)
    (N+1)
    #end

else the expression 2*Successor(N) would result in 2*N+1 which is
interpreted as (2*N)+1 due to the priority of * over +.

Using all-lowercase identifiers is a bit dangerous. If you want
"future-proof" macros, no such variables should be used to avoid
conflicts with current or future keywords and with keywords of
unofficial versions of POV-Ray.

   Sputnik


Post a reply to this message

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