Trigonometry : angle between 2 known lines 
First of all, I am sorry if my English is super terrible.
I'm going to make a program to calculate Zoeprit's equation. I'm stuck at making the algorithm because of my poor math skill.
the sketch is something look like this :
http://oi39.tinypic.com/6els0z.jpg
How do we find the angle of $a$ and $b$, if for example we know $X= 1000 and Z= 1000$ ?
Thank you in advance
 A: Here we divide the side having lenght X=1000 in two parts x and (1000-x).
then apply sine ratio
$$\sin A=\dfrac x{hypo_1}\implies \sin A=\dfrac {x}{hypo_1}$$
same in other triangle
$$\sin B=\dfrac {1000-x}{hypo_2}\implies \sin B=\dfrac {1000-x}{hypo_2}$$
using pytagoreous theorem in both triangle we can find out hypotaneous
$$hypo_1^2=x^2+1000^2,hypo_2^2={(1000-x)^2}+1000^2$$
now use $$\dfrac {\sin A}{\sin B}=\dfrac 14$$
As we've value of hypotanous of both right angle triangle in term of x,put those value in above equation then we get x and then we can find out value of sine ration of angle A and B.
hypo1 and hyp02 are hypotaneous of both triangle.and I use A and B instead of a and b.
A: Note that $a+b=90^{\circ}$ because the two small triangles are similar.    This means the left hand angle is $b$ and the right hand angle is $a$.  If we let the side opposite $a$ be $A$ and the side opposite $b$ be $B$, we have $A+B=X$.  We also have $\tan a=\frac AZ, \tan b=\frac BZ$  Then from the law of sines, $\frac AZ=\frac 14$.  Can you take it from here?
