POV-Ray : Newsgroups : povray.general : sign "M" : Re: sign "M" Server Time
5 Aug 2024 22:18:34 EDT (-0400)
  Re: sign "M"  
From: Tor Olav Kristensen
Date: 23 Jul 2002 16:39:44
Message: <3D3DBF83.DB21D873@hotmail.com>
Christopher James Huff wrote:
> 
> In article <3D3D9D92.C5EB47FF@hotmail.com>,
>  Tor Olav Kristensen <tor### [at] hotmailcom> wrote:
> 
> > I agree with you that sigs are better without includes, but since f_r() is
> > an internal function, I made an exception; because the only "legal" way to
> > call such internal functions is via the "functions.inc" file.
> 
> math.inc also includes the functions.inc file, and has a shorter name.
> Why not use the sqrt() function? sqrt(x*x+y*y) will be the same as
> f_r(x,y,0), and won't need the #include.
> 
> light_source{y 2}sphere{20*z#macro p(c)#if(c>1)g(x-2*div(mod(c,49),7)+8,
> y-2*mod(c,7)+8,22)*p(div(c,49))#end#end#local g=function{abs(sin(9*sqrt(
> x*x+y*y)))*pow(3-min(3,sqrt(x*x+y*y)),2)/z+.9}9pigment{function{p(2399498
> )p(3257797)p(5762298)1}}}//M

Hmmm... The sqrt(x*x+y*y) substitution was my first thought.
But then I fooled myself in some strange way into believing
that the f_r() solution would be the shortest solution.
(At some point in the "evolution" it really was.)


> light_source{y 2}sphere{20*z#macro p(c)#if(c>1)g(x-2*div(mod(c,49),7)+8,
> y-2*mod(c,7)+8,22)*p(div(c,49))#end#end#local g=function{abs(sin(9*sqrt(
> x*x+y*y)))*pow(3-min(3,sqrt(x*x+y*y)),2)/z+.9}9pigment{function{p(2399498
> )p(3257797)p(5762298)1}}}//M

I still feel that it could be shortened further...


Tor Olav


Post a reply to this message

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