POV-Ray : Newsgroups : povray.general : Buggy trig? Server Time
9 Aug 2024 23:30:48 EDT (-0400)
  Buggy trig? (Message 21 to 23 of 23)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Chris Huff
Subject: Re: Buggy trig?
Date: 23 Jun 2000 14:19:13
Message: <chrishuff-99C52E.13233823062000@news.povray.org>
In article <slr### [at] tealhhjpat>, 
hjp### [at] SiKituwsracat (Peter J. Holzer) wrote:

> >(In the spirit of offering a solution, how about a "trig_units" keyword
> >in the global_settings, where a user could specify "degrees" or
> >"radians"?)
> 
> Not good. That would break existing include files. A pragma which
> affects only the source file it is in, but not any included files might
> be safer, but I'm not too sure about that. The only way I can see which
> wouldn't break compatibility would be a second set of functions (e.g.,
> dsin, dcos, ...) which uses degrees instead of radians. 

It should be pretty easy to implement an "#angle_unit" keyword that 
behaves like #version, you could get the current unit and save it, 
switch to your preferred unit inside your include file, and switch back 
without the user of the include knowing about it. Or you could use one 
unit in some places and another in others, depending on what you are 
doing. It could support degrees, radians, and whatever else you want, as 
well as a "standard" setting(degrees for rotate, radians for trig).

Most calculators allow you to do this, why not POV?

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Ron Parker
Subject: Re: Buggy trig?
Date: 23 Jun 2000 14:26:01
Message: <slrn8l7bj7.v2b.ron.parker@linux.parkerr.fwi.com>
On Fri, 23 Jun 2000 13:23:38 -0500, Chris Huff wrote:
>It should be pretty easy to implement an "#angle_unit" keyword that 
>behaves like #version, you could get the current unit and save it, 
>switch to your preferred unit inside your include file, and switch back 
>without the user of the include knowing about it. Or you could use one 
>unit in some places and another in others, depending on what you are 
>doing. It could support degrees, radians, and whatever else you want, as 
>well as a "standard" setting(degrees for rotate, radians for trig).
>
>Most calculators allow you to do this, why not POV?

Because we've heard of "locality of reference?"  Specifically, if I see
you taking the sine of an angle, how do I know which units you're in 
without reading the whole file up to that point?  Better to use macros
that make your intention clear.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Chris Huff
Subject: Re: Buggy trig?
Date: 23 Jun 2000 15:40:19
Message: <chrishuff-A7351A.14444523062000@news.povray.org>
In article <slr### [at] linuxparkerrfwicom>, 
ron### [at] povrayorg wrote:

> Because we've heard of "locality of reference?"  Specifically, if I see
> you taking the sine of an angle, how do I know which units you're in 
> without reading the whole file up to that point?  Better to use macros
> that make your intention clear.

True...it might make writing the files slightly easier, but it 
definitely wouldn't be of any help in reading them.
Macros or functions with different names would be the best solution.

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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