POV-Ray : Newsgroups : povray.general : Re: what seems to be a general povray-unix bug (math?) : Re: what seems to be a general povray-unix bug (math?) Server Time
28 Jul 2024 22:16:11 EDT (-0400)
  Re: what seems to be a general povray-unix bug (math?)  
From: Peter J  Holzer
Date: 22 Jan 2001 08:06:22
Message: <slrn96oas8.fk0.hjp-usenet@teal.h.hjp.at>
[ I can't see Dan's original article for some reason, so I may be a bit
out of context ]

On 2001-01-14 23:52, Chris Huff <chr### [at] maccom> wrote:
>If you put:
>#debug concat("rotate < ", str(rbshx, 1, 1), ", ", str(rbshy, 1, 1), ", 
>", str(rbshz, 1, 1), ">")
>in your scene, you will see that "rgshx" is NaN (Not a Number). The NaN 
>gets into the matrix and fouls things up. If you put;
>#debug concat("acos(", str((len/2)/0.78, 1, 1), ")\n")
>you will see that you are attempting to calculate the arc-sine of 1, 
>which seems to be undefined.

The arc-cosine of 1 should be defined (0), but the arc-cosine of any
value above 1 isn't. He is probably trying to compute asin(1.0000001)
or something like that, especially since there is a mysterious constant
"0.78" above, which looks as if it was rounded to two digits. Never
round numbers[1], always let povray do the calculations. I.e., if you want
the square root of two, write sqrt(2), not 1.41.

	hp

[1] Of course the computer rounds, too, but it uses more digits and -
more importantly - its rounding rules are consistent with its arithmetic
rules.

-- 
   _  | Peter J. Holzer    | All Linux applications run on Solaris,
|_|_) | Sysadmin WSR       | which is our implementation of Linux.
| |   | hjp### [at] wsracat      | 
__/   | http://www.hjp.at/ |	-- Scott McNealy, Dec. 2000


Post a reply to this message

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