4

I have the following equation, and I want to solve for $\theta$ :

$$f(x,y,\theta) = \frac{x \cos(\theta) - y \sin(\theta)}{x \sin(\theta) + y \cos(\theta)}$$

It seems to me this equation should be easily solvable given known $x$ and $y$, however I cannot find it. Any help/hints?

EDIT: There was an error in my equation. I also must add that I know the value of $f$. Currently working on it with the tip given by Chandrasekhar.

It is important to note that $\theta$ and $x$, $y$ are not related. Yes it can be seen as a rotation... (or the division of the two terms from a rotation).

levesque
  • 1,429

2 Answers2

7

Let $x = r \sin(\alpha)$ and $y = -r \cos(\alpha)$. Then $$ f(x,y,\theta) = \frac{ \sin(\alpha) \cos(\theta) + \cos(\alpha) \sin(\theta)}{ \sin(\alpha) \sin(\theta) - \cos(\alpha) \cos(\theta)} = \frac{ \sin( \alpha+\theta )}{ \cos(\alpha+\theta)} = \tan(\alpha+\theta) $$

Sasha
  • 70,631
  • 1
    Simply beautiful. – levesque Oct 14 '11 at 16:14
  • Better yet, it might have been more natural to set $x=\rho\cos,\beta$ and $y=\rho\sin,\beta$, leading to the expression $\cot(\theta+\beta)$... – J. M. ain't a mathematician Oct 14 '11 at 16:28
  • 1
    @j.M. That is how I had it initially, but in former Soviet Union, they did not favor cotangents, so I changed the parameterization to get the tangent. Why do you say the contangent would have been better ? – Sasha Oct 14 '11 at 16:31
  • I did say "might", and somehow it felt more natural to have $x$ correspond to "cosine" and $y$ to correspond to "sine". The two approaches are equivalent, of course... :) Interesting bit about Soviet trigonometry... why is $\mathrm{ctg}$ frowned upon? – J. M. ain't a mathematician Oct 14 '11 at 16:35
  • @J.M. I actually do not know. It was present in encyclopedias, but was not taught in schools, so I always tend to write things in $\tan$, $\sin$, $\cos$, avoiding $\cot$, $\sec$ and $\csc$. – Sasha Oct 14 '11 at 16:41
2

First observe

$f(x,y,\theta ) = \frac{1 - y/x}{\tan \theta + y/x} $.

Then $ 1 - y/x = f * (\tan \theta + y/x)$, $\tan \theta = (1 - (1+f) y/x) / f$, and

$ \theta = \tan^{-1} \left( \frac{1 - (1+f) \frac{y}{x}}{f} \right) $.

Of course all of this assumes $x\neq 0$ and $\cos \theta \neq 0$. I'll leave you to figure out how to deal with those cases.

Craig
  • 3,536