POV-Ray : Newsgroups : povray.bugreports : Erroneous edge case trigonometric function values : Re: Erroneous edge case trigonometric function values Server Time
19 Oct 2025 03:21:40 EDT (-0400)
  Re: Erroneous edge case trigonometric function values  
From: Bald Eagle
Date: 16 Oct 2025 09:00:00
Message: <web.68f0eb72dc2f5cb9a433a43625979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
>
> > This isn't so much a bug as a floating point limitation.  Pi/2 has no
> > exact representation in binary, so you never get exactly 90 degrees.

And following along with that:   how do we then calculate cos (pi/2) and get
exactly 0, or sin (pi/2) and get 1?

Can we ever get exactly pi/2?  Pi?  3pi/2?  2pi?

Also when I was testing at theta=0, I was getting Inf for csc(Theta).
It just seems to me that basic unit circle functions ought to be implemented
well enough to handle the complementary situation at Theta=pi/2.

I don't have access to the parser for another 8h, so perhaps someone can run a
few loops to spit out values, or investigate the cylinder rendering issue.

- BW


Post a reply to this message

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