POV-Ray : Newsgroups : povray.general : Calculating rotation angle Server Time
8 Aug 2024 04:08:46 EDT (-0400)
  Calculating rotation angle (Message 1 to 2 of 2)  
From: MPunk3
Subject: Calculating rotation angle
Date: 6 Apr 2001 16:19:35
Message: <3ace24d7$1@news.povray.org>
Let's say I have an imaginary line extending up 14 units from the origin and
another line at a right angle going out 15.65 units from the origin.

How do I calculate the angle of the line which connects those endpoints?

I thought I'd do A = 1/sin(a/c) where a is 14 and c is the hypotenuse (calc
w/pythag) but that comes out to about 88 degrees, which clearly isn't right.

Then I went into Visio and threw down two lines, connected them, and checked
to see what Visio reports -- it comes up with 41.8148 degrees, which sounded
fairly good.

But weirdly, when I try it in POV, it comes out just a tiny bit off, maybe
by a degree or so.

So who's right? POV or Visio? Why wouldn't this add up?

And what is the calc, anyway?
(Hey, I've been out of school for 20 years...)

Thanks-- j.


Post a reply to this message

From: Ron Parker
Subject: Re: Calculating rotation angle
Date: 6 Apr 2001 16:40:20
Message: <slrn9csac1.12m.ron.parker@fwi.com>
On Fri, 6 Apr 2001 16:20:26 -0400, MPunk3 wrote:
>Let's say I have an imaginary line extending up 14 units from the origin and
>another line at a right angle going out 15.65 units from the origin.
>
>How do I calculate the angle of the line which connects those endpoints?

atan2(14,15.65) = 41.814818635216882095569966797115 degrees.  More or less.

You didn't fully specify the problem, though.  That result is for the 
smallest of the three angles in the triangle.  The other angle is the
complement of that.

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


Post a reply to this message

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