Is there a way to solve an equation with both Sine and Cosine in it?

4.2k Views Asked by At

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

1

There are 1 best solutions below

2
On

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