POV-Ray : Newsgroups : povray.advanced-users : Square roots of negative numbers in isosurfaces? : Re: Square roots of negative numbers in isosurfaces? Server Time
30 Jul 2024 12:25:28 EDT (-0400)
  Re: Square roots of negative numbers in isosurfaces?  
From: Matt Giwer
Date: 18 Jan 2000 00:15:58
Message: <3883F73F.9ED303FD@ij.net>
"Greg M. Johnson" wrote:

> Matt Giwer wrote:
>
> > "Greg M. Johnson" wrote:
> > > what is x^a?
> >     x to the power a or exp( a * log(x) )
> >     If a = 2 then it would be x*x
>
> Nope.  You cannot take the ln(x) of a negative x! Therefore, that's NOT what povray
> is doing!  My guess is

    I do abs(x) when I have such problems. Mathematicians hate me but it usually
works.


> x^a= sign(x)^int(a)* abs(x)^a .

    sign(x) is my second last resort. I'd rather avoid it as it usually does not work
being function specific as to whether or not it works. My last resort is actually
digging into the function and making sense of it.


> My re-writing of the function is "defined" for all values of x and a, whereas x^a is
> NOT.

    The idea of epsilon, for small values of zero, is also a useful compuational
concept. x+.000001 never hurts when folks do theoretical implementations.


> Again, I hound this point not to attack the giants whose shoulder we stand on--pov
> developers--but to have fun at solving a mathematical mystery : what IS pov doing?

    I do not claim to know all the computational tricks, but I think I do. If you are
really into a function you can find more adaptive ways to avoid problems. But I can't
remember the +.000001 trick failing since 1967. You can't publish the trick without
showing it applies but if it works ... So what is your audience?

    I am sure there are but I do not know of any smooth function (not discontinuous
like
1 and 0 binary) that has any problems with evaluation at any point but real zero. And
with a smooth function the small value always works.

    This not new so I guess I am missing your problem. Care to repeat or rephrase?


Post a reply to this message

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