POV-Ray : Newsgroups : povray.general : Buggy trig? Server Time
9 Aug 2024 21:14:54 EDT (-0400)
  Buggy trig? (Message 11 to 20 of 23)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>
From: Peter J  Holzer
Subject: Re: Buggy trig?
Date: 4 Jun 2000 22:04:08
Message: <slrn8jlo50.h9n.hjp-usenet@teal.h.hjp.at>
On Sun, 04 Jun 2000 12:46:20 -0700, Xplo Eristotle wrote:
>Simen Kvaal wrote:
>> 
>> >A short history question: Was there a reason for using degrees with
>> >rotate and radians with the trigonometric functions, or did just
>> >happen that way?
>>
>> I'd say it's quite natural that the _functions_ take radians as
>> parameters, because in mathematics, you rarely use degrees to express
>> angles and/or to perform trigonometric oerations, to put it that way.

Actually, in school, we used degrees almost exclusively. Radians are
a lot more logical way to express an angle (there is a good reason that
a full circle has 2 pi radians, but there isn't any good reason it has
360 degrees) and it makes a lot of formulas simpler, but in geometry
people don't think in radians, but in degrees.

>> As for the rotations, the degrees is for many a more natural and
>> intuitive approach to orientation in space. You don't say "turn
>> around pi", but "turn around 180 degrees." Maybe it would be natural
>> to have alternate rotate-definitions, accepting radians?
>
>It would be more natural, IMO, to have trig that accepts degrees. When
>I was taking trig, we did plenty of work with degrees.. and in fact,
>since we specify angles in degrees pretty much everywhere BUT in a
>classroom - even my scientific calculator uses degrees by default - I
>don't see the point of using radians, which almost no one is familiar
>with.
>
>I don't WANT to rotate an object by 1/6th pi. I don't *NEED* to rotate
>an object by 1/6th pi. But it would be nice to ask for sin(30) and get
>.5 back.

I agree. Well, actually, I don't care much whether angles are specified
in degrees, radians, hours, or whatever, but I would like to have the
same unit everywhere.


>(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. 

Oh well, might as well leave it as it is, it's a minor nuisance. 

	hp


-- 
   _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
|_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
| |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
__/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

From: Simen Kvaal
Subject: Re: Buggy trig?
Date: 5 Jun 2000 02:28:42
Message: <393b489a$1@news.povray.org>
>
>Actually, in school, we used degrees almost exclusively.

=:O You had a BAD teacher!!

>Radians are
>a lot more logical way to express an angle (there is a good reason that
>a full circle has 2 pi radians, but there isn't any good reason it has
>360 degrees) and it makes a lot of formulas simpler, but in geometry
>people don't think in radians, but in degrees.
>

Hm. Yes and no. When using sin() functions, for example in physics
(modelling mechanical waves is an example), I really don't bother with the
degrees option. But I also say "the sum of the angles in a triangle is 180";
not pi...

Simen.


Post a reply to this message

From: Warp
Subject: Re: Buggy trig?
Date: 5 Jun 2000 05:53:14
Message: <393b7889@news.povray.org>
Xplo Eristotle <inq### [at] unforgettablecom> wrote:
: It would be more natural, IMO, to have trig that accepts degrees.

  I would not mind if the rotate command would be changed to take radians
instead of degress. I would seriously mind if the trigonometric functions
would be changed to take degrees instead of radians.
  Mathematical functions are exactly that: Mathematical functions. There is
a very good reason to use radians for the trigonometric functions in
mathematics. For example the integral of 1/(1+x^2) is atan(x). You can
easily imagine why it would not not work with degrees.
  Changing the rotate command to take radians would make povray consistent.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ken
Subject: Re: Buggy trig?
Date: 5 Jun 2000 12:17:08
Message: <393BD206.5C6974F1@pacbell.net>
Warp wrote:

>   Changing the rotate command to take radians would make povray consistent.

...but less intuitive for those with poor math backgrounds.

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Gilles Tran
Subject: Re: Buggy trig?
Date: 5 Jun 2000 15:35:07
Message: <393C009D.D554CECD@inapg.inra.fr>
Ken wrote:

> Warp wrote:
>
> >   Changing the rotate command to take radians would make povray consistent.
>
> ...but less intuitive for those with poor math backgrounds.

... and let's not forget the rewriting of the couple of old scenes that used the
rotate command, silly them, they should have known better ;-)

G.


Post a reply to this message

From: Peter Popov
Subject: Re: Buggy trig?
Date: 6 Jun 2000 00:29:14
Message: <9hgmjskk6pqh9t3ae668mt060e52trvfql@4ax.com>
On Sun, 04 Jun 2000 19:04:29 -0400, John VanSickle
<van### [at] erolscom> wrote:

>Xplo Eristotle wrote:
>> 
>> I don't WANT to rotate an object by 1/6th pi. I don't *NEED* to rotate
>> an object by 1/6th pi.
>
>Me neither.  I always do it this way:
>
>  matrix <1,0,0, 0,sqrt(.75),.5, 0,-.5,sqrt(.75), 0,0,0>

Yes but there can be only One who can control the Matrix so your point
has not been taken into account :))


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Fabien Mosen
Subject: Re: Buggy trig?
Date: 6 Jun 2000 01:20:22
Message: <393C889B.DD0E1806@skynet.be>
"Peter J. Holzer" wrote:
> 
> On Sun, 04 Jun 2000 02:43:37 +0100, Thorsten Froehlich wrote:
> >The trigonometric functions use radians which is clearly stated in the
> >documentation.
> 
> A short history question: Was there a reason for using degrees with
> rotate and radians with the trigonometric functions, or did just happen
> that way?

While radians are a matter of trigonometry, degrees are more logical
when dealing with geometry.

Fabien.


Post a reply to this message

From: Philippe Debar
Subject: Re: Buggy trig?
Date: 6 Jun 2000 12:11:48
Message: <393d22c4$1@news.povray.org>
// From my own macros
// (not made public because they are either very simple or quite esoteric)
// (but I post them whenever someone might need them)
// Povingly,
// Philippe Debar



// Tired of degrees/radians conversions? try these!

#macro sind(A)
  (sin(radians(A)))
#end

#macro cosd(A)
  (cos(radians(A)))
#end

#macro tand(A)
  (tan(radians(A)))
#end

#macro asind(A)
  (degrees(asin(A)))
#end

#macro acosd(A)
  (degrees(acos(A)))
#end

#macro atan2d(A,B)
  (degrees(atan2(A,B)))
#end


Post a reply to this message

From: Rune
Subject: Re: Buggy trig?
Date: 6 Jun 2000 20:21:51
Message: <393d959f@news.povray.org>
"Philippe Debar" wrote:
> // Tired of degrees/radians conversions? try these!

Nice and simple!

As an addition I just made the ones below.
They're not tested, but they should work.

#macro rotater(A)
   rotate <degrees(A.x),degrees(A.y),degrees(A.z)>
#end

#macro vrotater(A,B)
   vrotate(A,<degrees(B.x),degrees(B.y),degrees(B.z)>)
#end

#macro vaxis_rotater(A,B,C)
   vaxis_rotate(A,B,degrees(C))
#end

Greetings,

Rune

---
Updated April 25: http://rsj.mobilixnet.dk
Containing 3D images, stereograms, tutorials,
The POV Desktop Theme, 350+ raytracing jokes,
miscellaneous other things, and a lot of fun!


Post a reply to this message

From: Margus Ramst
Subject: Re: Buggy trig?
Date: 6 Jun 2000 20:31:32
Message: <393D8A17.DF156E68@peak.edu.ee>
Rune wrote:
> 
> #macro rotater(A)
>    rotate <degrees(A.x),degrees(A.y),degrees(A.z)>
> #end
> 

I usually add explicit vector promotion to such macros:

#macro rotater(A)
   #local An = A + <0,0,0>;
   rotate <degrees(An.x),degrees(An.y),degrees(An.z)>
#end

This is so you can use a float parameter like in regular rotate.

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>

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