Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|cite|improve this question
Hint: Take a triangle with sides $x$ and $y$. Just divide the numerator and denominator by $\sqrt{x^{2}+y^{2}}$. – user9413 Oct 14 '11 at 15:12
What is $f$ equal to? What you have there looks to have been the result of rotating coordinates... – J. M. Oct 14 '11 at 15:13
I forgot to say that I also know what $f$ is equal to... – levesque Oct 14 '11 at 15:16
up vote 7 down vote accepted

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

share|cite|improve this answer
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. Oct 14 '11 at 16:28
@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. 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

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.

share|cite|improve this answer
One might need the services of the two-argument arctangent here... :) – J. M. Oct 14 '11 at 15:19
Note to all: The question was modified after this answer was posted, so it addresses the first version of the question. – Srivatsan Oct 14 '11 at 15:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.