# difference of angles?

• June 27th 2006, 05:23 PM
Excess Thoughts
difference of angles? (image bug fixed)
Hello there everyone... I could really use some help with a question. I'm in the middle of making a 3d game engine... and there's just this one problem that I can't seem to get through... It's difficult to explain, so here:http://aycu30.webshots.com/image/989...4825285_th.jpg is a quick picture I made to make it easier to understand what I need...

You are given the values of A,B,C,D, and theta... what I need is a simple equation (or equations) that I could use to find ? for any real values of A,B,C,D, and theta. Is that even possible? I would appreciate anything (the sooner the better...) Thank you in advance.

- Scott
• June 27th 2006, 06:04 PM
ThePerfectHacker
Quote:

Originally Posted by Excess Thoughts
I'm in the middle of making a 3d game engine..

Wow, you must be so cool
Quote:

Originally Posted by Excess Thoughts
Is that even possible?

No, from the way I understand it.
• June 27th 2006, 06:58 PM
JakeD
Quote:

Originally Posted by Excess Thoughts
Hello there everyone... I could really use some help with a question. I'm in the middle of making a 3d game engine... and there's just this one problem that I can't seem to get through... It's difficult to explain, so here:http://aycu30.webshots.com/image/989...4825285_th.jpg is a quick picture I made to make it easier to understand what I need...

You are given the values of A,B,C,D, and theta... what I need is a simple equation (or equations) that I could use to find ? for any real values of A,B,C,D, and theta. Is that even possible? I would appreciate anything (the sooner the better...) Thank you in advance.

- Scott

$x = \theta - \tan^{-1}((D-B)/(C-A)) .$
• June 27th 2006, 07:06 PM
Soroban
Hello, Scott!

Quote:

You are given the values of $A,\,B,\,C,\,D,\,\theta = \angle ROX$
What I need is a simple equation (or equations) that I could use to find $\angle ROQ$
for any real values of $A,\,B,\,C,\,D,\,\theta$
Code:

      R o                    o Q           \  * * *        /           *\          *  /         *  \          *       *    \        /  *               \    /       *        \  /      *       *        O* - - - - * - - X       *      /(C,D)      *             /       *  /              *         *              *       /  *          *   P o        * * *   (A,B)

We are given: $\theta = \angle ROX$.
We want $\angle ROQ$.

$m_1\:=\:m_{PQ} \;= \;m_{PO} \;= \;\frac{D-B}{C-A}$

$m_2\;=\;\tan\theta$

The angle $\phi$ between two lines is given by: . $\tan \phi \:=\:\frac{m_2 - m_1}{1 + m_1\cdot m_2}$

So we have: . $\tan(\angle ROQ) \;=\;\frac{\tan\theta - \frac{D-B}{C-A}}{1 + \frac{D-B}{C-A}\cdot\tan\theta}$

Therefore: . $\angle ROQ\;=\;\arctan\left[\frac{(C-A)\tan\theta - (D - B)}{(C - A) - (D - B)\tan\theta}\right]$

• June 27th 2006, 07:09 PM
ThePerfectHacker
Am I missing something here.
He is asking for '?' not for theta.
There is no way to find '?'
Since that radius vector can be anywhere. Unless you know its coordinates (which you do not).
• June 27th 2006, 10:06 PM
JakeD
Quote:

Originally Posted by Soroban
$\angle ROQ\;=\;\arctan\left[\frac{(C-A)\tan\theta - (D - B)}{(C - A) - (D - B)\tan\theta}\right]$

Quote:

Originally Posted by JakeD
$x = \theta - \tan^{-1}((D-B)/(C-A)) .$

My $x = \angle ROQ .$ I put these two formulas in a spreadsheet and checked that they do give the same values for various inputs. How would you prove this?
• June 27th 2006, 10:13 PM
malaygoel
Quote:

Originally Posted by JakeD
My $x = \angle ROQ .$ I put these two formulas in a spreadsheet and checked that they do give the same values for various inputs. How would you prove this?

Hello JakeD!
Let $D-B=(C-A)tany$
Substitute in Soroban's expression and you will arrive at your expression

Keep Smiling
Malay
• June 27th 2006, 10:46 PM
JakeD
Quote:

Originally Posted by malaygoel
Hello JakeD!
Let $D-B=(C-A)tany$
Substitute in Soroban's expression and you will arrive at your expression

Keep Smiling
Malay

Thanks for the reply, Malay. I tried what you suggested and didn't get an immediate result, so I'm not sure what you meant. Is this what you had in mind? Using

$\tan y = (D-B)/C-A)$

I get from my expression

$x = \theta - y$

and from Soroban's

$\tan x = \frac{\tan \theta - \tan y}{1+\tan y \tan \theta}.$

Substituting in the above expression for $x$ yields

$\tan (\theta - y) = \frac{\tan \theta - \tan y}{1+\tan y \tan \theta}$

which is one of the trig identities
http://www.sosmath.com/trig/Trig5/trig5/img6.gif
• June 27th 2006, 10:59 PM
malaygoel
Quote:

Originally Posted by JakeD
Thanks for the reply, Malay. I tried what you suggested and didn't get an immediate result, so I'm not sure what you meant. Is this what you had in mind? Using

$\tan y = (D-B)/C-A)$

I get from my expression

$x = \theta - y$

and from Soroban's

$\tan x = \frac{\tan \theta - \tan y}{1+\tan y \tan \theta}.$

Substituting in the above expression for $x$ yields

$\tan (\theta - y) = \frac{\tan \theta - \tan y}{1+\tan y \tan \theta}$

After the substitution inSoroban's expression, you will get
arctan $\frac{\tan \theta - \tan y}{1+\tan y \tan \theta}$
which is equal to
arctan $\tan (\theta - y)$
which is equal to
$\theta-y$
which is equal to
$\theta-\tan^{-1}((D-B)/(C-A))$which is your expression

Keep Smiling
Malay