POV-Ray : Newsgroups : povray.text.scene-files : Gaussian random numbers : RE: Gaussian random numbers Server Time
8 Jul 2024 13:11:36 EDT (-0400)
  RE: Gaussian random numbers  
From: Pablo Viojo
Date: 6 Jul 2001 22:07:59
Message: <3b466eff@news.povray.org>
Hi all,

> And here's the macro:
>
> #declare e = 2.718281828459;
> #macro gauss(RSR)
>   sqrt(-2*log(rand(RSR))/log(e))*cos(2*pi*rand(RSR))
> #end
>

I tried it and Pov-Ray assumes "log" is in base e, so log(e)=1 and you don't
need it.

But the formula would stand correct if you assume log is in base 10 because
of the base change formula log BASE e(x) = log BASE 10(x) / log BASE 10(e)

Greets
Pablo Viojo.-
pvi### [at] adinetcomuy


Post a reply to this message

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