|
![](/i/fill.gif) |
[ 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] mac com> 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] wsr ac at |
__/ | http://www.hjp.at/ | -- Scott McNealy, Dec. 2000
Post a reply to this message
|
![](/i/fill.gif) |