-1
$\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.)

  • 0
    Please use [$\rm \LaTeX$](http://meta.math.stackexchange.com/q/5020/290189).2017-02-28

1 Answers 1

0

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

  • 0
    Could you explain where these formulas are coming from? Or what this method of solving the trigonometric equation is called?2017-03-01
  • 0
    Subtraction formula for cosine.2017-03-01