POV-Ray : Newsgroups : povray.advanced-users : function accuracy? Server Time
28 Jul 2024 16:27:10 EDT (-0400)
  function accuracy? (Message 1 to 3 of 3)  
From: Jim Charter
Subject: function accuracy?
Date: 13 Mar 2005 20:37:53
Message: <4234eaf1$1@news.povray.org>
If I run this sdl:


#debug "\nStart of Process\n"

#debug #concat ("\n atan2= ", str( degrees(atan2(5,16)),2,6), "\n")

#declare Pos =
vrotate ( <0,0,16>, <-degrees(atan2(5,16)), 0, 0> );

#debug #concat ("\n y= ", str( Pos.y,2,6), "\n")

#debug #concat ("\n z= ", str( Pos.z,2,6), "\n")

#debug "\nEnd of Process\n"


I get this result:


Start of Process

  atan2= 17.354025

  y= 4.772400

  z= 15.271680

End of Process

On the face of it I looks like either vrotate or atan2 is only accurate 
to within 5% ?

I would have expected more accuracy.  Are my expectations wrong?  Is my 
thinking wrong?  Am I invoking the functions wrong?  Using debug wrong? 
  This is running MegaPov 1.0 on XP and Athlon 64


Post a reply to this message

From: Slime
Subject: Re: function accuracy?
Date: 13 Mar 2005 21:00:07
Message: <4234f027@news.povray.org>
> On the face of it I looks like either vrotate or atan2 is only accurate
> to within 5% ?

If you're expecting y=5 and z=16, then you need to make sure that the
starting vector has the same length as the vector <0,5,16>. That means you
should start with the vector <0,0,sqrt(5*5+16*16)>. As it is, you're
starting with a vector that is shorter than that, so you get y slightly less
than 5 and z slightly less than 16.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Jim Charter
Subject: Re: function accuracy?
Date: 13 Mar 2005 21:06:54
Message: <4234f1be$1@news.povray.org>
Slime wrote:
>>On the face of it I looks like either vrotate or atan2 is only accurate
>>to within 5% ?
> 
> 
> If you're expecting y=5 and z=16, then you need to make sure that the
> starting vector has the same length as the vector <0,5,16>. That means you
> should start with the vector <0,0,sqrt(5*5+16*16)>. As it is, you're
> starting with a vector that is shorter than that, so you get y slightly less
> than 5 and z slightly less than 16.
> 
>  - Slime
>  [ http://www.slimeland.com/ ]
> 
> 
Thanks for being kine.  Yes I see my mistake now.


Post a reply to this message

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