POV-Ray : Newsgroups : povray.general : What is wrong with this? : Re: What is wrong with this? Server Time
2 Jul 2024 10:39:19 EDT (-0400)
  Re: What is wrong with this?  
From: Jerome M  BERGER
Date: 1 Sep 1999 13:19:43
Message: <37CD6031.D2359752@enst.fr>
TonyB wrote:
> 
> Hello. I am having a small math problem. All my life I have found this
> to be true. I even tried it on paper, and it works.
> 
> A/2 + B/2 = (A + B)/2
> 
> Am I wrong? The reason I ask is because of something that happened to me
> while playing with Jaime Vives' clouds. The line that reads:
> 
> #declare p=sky_color*.5+White*.5;
> 
> *can* be re-written as:
> 
> #declare p=(sky_color+White)/2;
> 
> right? At least according to my formula. But for some odd reason, POV
> says NO. Try it. I will post an image to the corresponding group
> shortly.
> 
> --
> Anthony L. Bennett
> http://welcome.to/TonyB
> 
> Non nova, sed nove.

It depends on the way sky_color is defined and on the way povray treats
#declare... If sky_color is declared as a+b (no parethesis) and pov
simply replaces (the way it works in c/c++) the first line is in fact:
a+b*.5+White*.5
and the second is:
(a+b+White)/2
which is completely different...

Just my 2 cents

		Jerome

-- 
*******************************

* they'll tell you what can't * mailto:ber### [at] inamecom
* be done and why...          * http://www.enst.fr/~jberger
* Then do it.                 *
*******************************


Post a reply to this message

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