I have the following pair of equations:

$a = x\cos(k) - y\sin(k),\ b = x\sin(k) + y\cos(k)$

I know that all variables but $k$ are in the set $\mathbb{N}^0$.

Given the above, if I know the value of $a$, $b$, and $k$, how do I compute $x$ and $y$?

  • $\begingroup$ HINT: Solve the two linear simultaneous equations for $x,y$ in terms of $a,b,k$ $\endgroup$ – lab bhattacharjee Dec 7 '14 at 17:06
  • $\begingroup$ I'm not sure how they're simultaneous, or how I'd re-write them. I'm sure you're correct, I just can't seem to visualise it. $\endgroup$ – Polynomial Dec 7 '14 at 17:08
  • $\begingroup$ Given a value of $k$, $k_0$, there will most likely be a solution to your equations. However, if you have more than one, you probably need to look into least squares methods. $\endgroup$ – robjohn Dec 7 '14 at 17:16
  • $\begingroup$ @robjohn You've lost me there. $k$ is unchanging across the data set. $\endgroup$ – Polynomial Dec 7 '14 at 17:19
  • $\begingroup$ @Polynomial: wait are you saying that $k$ is a constant value? I thought $k$ was from a data set. What is varying across the data set? $\endgroup$ – robjohn Dec 7 '14 at 18:32

If we know $a$, $b$, and $k$, we have the matrix equations $$ \begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}\cos(k)&-\sin(k)\\\sin(k)&\cos(k)\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}\\ \Downarrow\\ \begin{bmatrix}\cos(k)&\sin(k)\\-\sin(k)&\cos(k)\end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}x\\y\end{bmatrix} $$ which solve for $x$ and $y$.

For Those Who Haven't Seen Matrices Before

The first matrix equation above is a restatement of the question. The second matrix equation is the first multiplied by the inverse of the $2\times2$ matrix, and represents the solution $$ \begin{align} x&=\hphantom{-}a\cos(k)+b\sin(k)\\ y&=-a\sin(k)+b\cos(k) \end{align} $$ If you plug in the values for $a$ and $b$ from the question, you will see that $$ \begin{align} \hphantom{-}a\cos(k)+b\sin(k)&=\hphantom{-}\overbrace{(x\cos(k)-y\sin(k))}^a\cos(k)+\overbrace{(x\sin(k)+y\cos(k))}^b\sin(k)=x\\ -a\sin(k)+b\cos(k)&=-(x\cos(k)-y\sin(k))\sin(k)+(x\sin(k)+y\cos(k))\cos(k)=y \end{align} $$ since $\cos^2(k)+\sin^2(k)=1$.

| cite | improve this answer | |
  • $\begingroup$ Sorry, I don't know what that means. Could you provide a worked example, please? $\endgroup$ – Polynomial Dec 7 '14 at 18:41
  • $\begingroup$ I have added a section to the answer. I hope it helps. $\endgroup$ – robjohn Dec 7 '14 at 18:58
  • $\begingroup$ Brilliant. Solved my problem perfectly! :D $\endgroup$ – Polynomial Dec 7 '14 at 19:00
  • $\begingroup$ @Polynomial: The reason that a number of people on this site are sticklers that context be given with questions is just this. I had no idea that you did not know about matrices. The question appears to be from a beginning linear algebra course, and that is how I first answered it. $\endgroup$ – robjohn Dec 7 '14 at 19:15
  • $\begingroup$ Ah, ok. This whole thing was part of a weird crypto thing I was trying to solve, rather than a set problem. $\endgroup$ – Polynomial Dec 7 '14 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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