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] iname com
* be done and why... * http://www.enst.fr/~jberger
* Then do it. *
*******************************
Post a reply to this message
|