POV-Ray : Newsgroups : povray.off-topic : Unexpected : Re: Unexpected Server Time
28 Jul 2024 22:23:40 EDT (-0400)
  Re: Unexpected  
From: Warp
Date: 18 Aug 2013 08:31:59
Message: <5210bebf@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> That /is/ scary - then again, maybe they didn't know the sqrt() function?

The most common problem was that, for some reason, they thought that
you had to calculate the formula differently for positive numbers than
for negative numbers. And since there are four possible combinations of
signs for the two parameters... (Even then you would think that it would
take like 8 lines: Four conditionals and four instances of the same
pythagorean formula. But no, it couldn't be that simple either. You see,
you have to first remove the sign in order to do the pythagorean theorem
with positive numbers only... which kind of reminds me of the abs() problem
referred to by Andrew. I don't even remember anymore how they managed to
get so many lines of code.)

I never quite understood what made them think that you can only calculate
the pythagorean formula with positive values. One would think that they
know that yes, you can raise a negative value to the power of two and that
the result will be positive, but seemingly it's not that simple.

The hilarious (or sad, depending on your persective) thing about it was
that they pretty much ended up writing the same code four times in their
implementation, inside four conditionals, without realizing it.

-- 
                                                          - Warp


Post a reply to this message

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