POV-Ray : Newsgroups : povray.general : Help with function : Re: Help with function Server Time
29 Jul 2024 14:26:13 EDT (-0400)
  Re: Help with function  
From: Robert McGregor
Date: 31 Mar 2011 10:45:01
Message: <web.4d9492df2c67487c86ff1d480@news.povray.org>
Jim Holsenback <jho### [at] povrayorg> wrote:
> On 03/31/2011 05:16 AM, Anthony D. Baye wrote:
> > can someone help me with the following transform:
> >
> > #local s = 1 / (2 * (1 + sum(k,1,n, cos(2*pi*k/n)) ));
>
> Just a casual glance so I might be wrong, but I think you're misusing
> the sum function

Yep, try something like this, with a function wrapper for sum:

#local fn = function(k,n) { sum(k,1,n, cos(2*pi*k/n)) }
#local s = 1 / (2 * (1 + fn(1,2)));

-------------------------------------------------
www.McGregorFineArt.com


Post a reply to this message

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