# Linear equation system

#### crapmathematician So... I've got the above linear equation system. I need to find alpha1 and alpha2, the rest is assumed as known. I was thinking of solving it by solving first equation for sina1 which equals to (x1-x2-d2*cosa2) / d1 and then substitute it into the second equation, but in order to do that I have to change it to cosa1. Looked through all the trigonometric identities, just can't find the solution... Any thoughts?

Thanks!!!

#### Soroban

MHF Hall of Honor
Hello, crapmathematician!

Too many subscripts . . . I'll simplify slightly.

But then, I haven't finished the problem either . . .

$$\displaystyle \begin{array}{cccccc} x_1 - d_1\sin\alpha &=& x_2 + d_2\cos\beta &  \\ y_1 - d_1\cos\alpha &=& y_2 + d_2\sin\beta &  \end{array}$$

Solve for $$\displaystyle \alpha\text{ and }\beta.$$
$$\displaystyle \begin{array}{ccccccc} \text{ becomes:} & d_1\sin\alpha + d_2\cos\beta & =& x_1-x_2 &  \\ \\[-3mm] \text{ becomes:} & d_1\cos\alpha + d_2\sin\beta &=& y_1-y_2 &  \end{array}$$

$$\displaystyle \begin{array}{ccccccc} \text{Square :} & d_1^2\sin^2\!\alpha + 2d_1d_2\sin\alpha\cos\beta + d_2^2\cos^2\!\beta &=& (x_1-x_2)^2 \\ \\[-3mm] \text{Square :} & d_1^2\cos^2\!\alpha + 2d_1d_2\sin\beta\cos\alpha + d_2^1\sin^2\!\beta &=& (y_1-y_2)^2 \end{array}$$

$$\displaystyle \text{Add: }\;d_1^2\underbrace{(\sin^2\!\alpha + \cos^2\!\alpha)}_{\text{This is 1}} + 2d_1d_2\underbrace{(\sin\alpha\cos\beta + \sin\beta\cos\alpha)}_{\text{This is }\sin(\alpha+\beta)} +$$ .$$\displaystyle d_2^2\underbrace{(\sin^2\!\beta + \cos^2\!\beta)}_{\text{This is 1}} \;=\;(x_1-x_2)^2 + (y_1-y_2)^2$$

We have: . $$\displaystyle d_1^2 + 2d_1d_2\sin(\alpha+\beta) + d_2^2 \;=\;(x_1-x_2)^2 + (y_1 - y_2)^2$$

Hence: . $$\displaystyle \sin(\alpha + \beta) \;=\;\frac{(x_1-x_2)^2 + (y_1-y_2)^2 - (d_1^2 + d_2^1)}{2d_1d_2}$$

Multiply  times :

. . $$\displaystyle d_1^2\sin\alpha\cos\alpha \;+\; d_1d_2\sin\alpha\sin\beta \;+\; d_1d_2\cos\alpha\cos\beta \;+\; d_2^2\sin\beta\cos\beta \;=\;(x_1-x_2)(y_1-y_2)$$

. . $$\displaystyle d_1d_2\underbrace{(\cos\alpha\cos\beta \;+\; \sin\alpha\sin\beta)}_{\text{This is }\cos(\alpha - \beta)} \;+\; \underbrace{d_1^2\sin\alpha\cos\alpha \;+\; d_2^2\sin\beta\cos\beta}_{\text{But these don't combine!}} \;=\;(x_1-x_2)(y_1-y_2)$$

So I've hit a wall . . .

The best I can do is:

. . $$\displaystyle d_1d_2\cos(\alpha - \beta) + \tfrac{1}{2}\left(d_1\sin2\alpha + d_2\sin2\beta\right) \;=\;(x_1-x_2)(y_1-y_2)$$

Any ideas?

#### crapmathematician

OK... I have tried to substitute
$$\displaystyle sin\alpha_1 = \tfrac {x_1-x_2-d_2\cos\alpha_2}{d_1}$$
(which I got from equation 1 when extracting for $$\displaystyle sin\alpha_1$$) into equation 2 by using a formula Sin(arccos x)=Cos(arcsinx)=sqrt(1-x^2). Thus I have put $$\displaystyle 1- (\tfrac {x_1-x_2-d_2\cos\alpha_2}{d_1})^2$$ into equation 2, though after solving I get something that is as huge as:

$$\displaystyle y_1^2 - d_1 (d_1 - x_1^2 + x_2^2 + d_2^2\cos^2\alpha_2 - 2x_2x_1 - 2x_1d_2\cos\alpha_2 + 2x_2d_2\cos\alpha_2) = y_2^2 + d_2^2\sin^2\alpha_2$$