|
|
Mike Horvath <mik### [at] gmailcom> wrote:
> On 11/10/2016 1:10 PM, Mike Horvath wrote:
> > I have this formula from Wikipedia:
> >
> > <math>A_v = </math> <math>\log_2</math> <math>A^2</math>
> >
> > How do I use this in POV-Ray? What is the correct syntax? Thanks.
> >
> >
> > Mike
>
>
> Never mind. I guessed the correct syntax.
It seems that \log_2 is the binary logarithm, which is not a standard float
function in POV-Ray (AFAIK).
You can get around this by doing something like this:
#declare BinLogFn = function(x) { ln(x)/ln(2) }
#declare Q = 8; // 2^3 = 8
#declare P = BinLogFn(Q);
#debug "\n\n"
#debug concat("2^", str(P, 0, -1), " = ", str(Q, 0, -1))
#debug "\n\n"
- But if you found the correct syntax, then you are probably aware of this.
--
Tor Olav
http://subcube.com
Post a reply to this message
|
|