POV-Ray : Newsgroups : povray.general : Pattern function errors : Re: Pattern function errors Server Time
30 Jul 2024 20:23:49 EDT (-0400)
  Re: Pattern function errors  
From: SharkD
Date: 7 Jul 2008 03:30:01
Message: <web.4871c5b183e204bdeb867ce10@news.povray.org>
Tim Nikias <JUS### [at] gmxnetWARE> wrote:
> SharkD wrote:
> > I am having problems with the following pattern:
> >
> > pigment
> > {
> >  function {sqrt(pow(x,2) + pow(z,2)) / cos(asin(abs(y)))}
> >  pigment_map
> >  {
> >   [0 color rgb 0]
> >   [1 color rgb <0,1,0,>]
> >  }
> > }
> >
> > POV-Ray gives the following error:
> >
> > "Parse Error: Floating-point exception detected in function ''. Your function
> > either attempted a division by zero, used a function outside
> > its domain or called an internal function with invalid parameters."
> >
> > Could somebody please explaing to me why this is and what I can do to fix it?
>
> The Error says it all: You're dividing by zero. Somewhere along the
> cosine of asin(abs(y)) the result is 0, which is what you'll be dividing by.
>
> Regards,
> Tim

I've tried changing the denominator of the fraction to
max(cos(asin(abs(y))),0.001) so that it doesn't divide by zero, but it has no
effect.

-Mike


Post a reply to this message

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