1. 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: 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

2. Originally Posted by Excess Thoughts
I'm in the middle of making a 3d game engine..
Wow, you must be so cool
Originally Posted by Excess Thoughts
Is that even possible?
No, from the way I understand it.

3. 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: 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)) .$

4. Hello, Scott!

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]$

5. 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).

6. Originally Posted by Soroban
$\angle ROQ\;=\;\arctan\left[\frac{(C-A)\tan\theta - (D - B)}{(C - A) - (D - B)\tan\theta}\right]$
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?

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

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

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