$\begingroup$

I'm trying to solve a system of equations. I end up with sine and cosine in one equation and the parameter of both as the last unknown. Like this:

num1 = num2 * sin(start) + num3 * cos(start) 

num1, num2, num3 are known scalars and start is an unknown scalar. So is there a simple way to solve this equation?


Original system of equations

:

ax + s * bx = cx ay + s * by = cy cx + rx * sin(start) = px cy + ry * cos(start) = py 

ax, ay, bx, by, px, py, rx, ry are known. s, start, cx, and cy are unknown. I figured 4 equations and 4 unknown must work somehow, right?
In the end I get:

px * by - ax * by + ay * bx - py * bx = ry * bx * cos(start) + rx * by * sin(start) 

(I'm a programmer. Sorry for the lack of math formulas.)

$\endgroup$1

1 Answer

$\begingroup$

To solve $a \cos(\theta) + b \sin(\theta) = c$, write this as $r \cos(\theta - \phi) = c$ where $r = \sqrt{a^2 + b^2}$, $\cos(\phi) = a/r$ and $\sin(\phi) = b/r$.

$\endgroup$2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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