Calculating the angle in which surfaces meet We have a L-shaped house. Both sides have gable roof. For one side, the inside angle is $45$ degrees and for the second one, $40$ degrees.
Question is, how many degrees is the line, in which both parts of the roof meet? Hopefully this pictures explains the question
http://s33.postimg.org/a0f83v4qn/maja.jpg
I want to find angles $1$ and $2$.
At first I thought about finding equations of two surfaces, finding the line, at which they meet and then calculating the angles. Is there a simpler, more elequent solution? 
 A: Let's say that the $z$ axis points up. Then the normal vectors to the two planes are
$$
n_1 = \begin{bmatrix} c \\ 0 \\ s \end{bmatrix}
$$
(where $c = \cos 22.5^\circ, s = \sin 22.5^\circ$), for the 45-degree roof
and
$$
n_2 = \begin{bmatrix} 0 \\ d \\ t \end{bmatrix}
$$
(where $d = \cos 20^\circ, t = \sin 20^\circ$), for the 40-degree roof. 
The line of intersection is in direction $n_1 \times n_2$, which is
$$
n_1 \times n_2 = \begin{bmatrix} -ds \\ -ct \\ -cd \end{bmatrix}
$$
The length of this is 
$$
L = \sqrt{(ds)^2 + (ct)^2 + (cd)^2}
$$
so a unit vector in that direction is just 
$$
v = \begin{bmatrix} -ds/L \\ -ct/L \\ -cd/L \end{bmatrix}
$$
The angle between this and the $y$-direction has cosine 
$$
\cos \theta_1 = v \cdot \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} = -ct/L
$$
so 
$$
\theta_1 = \arccos(-ct/L). 
$$
Similarly, 
$$
\theta_2 = \arccos(-ds/L). 
$$
I leave it to you to plug the numbers into your calculator. 
BTW, following @almagest, I should point out that these are the ACUTE angles between the two lines, so the angles YOU want are $180^\circ - \theta_1$ and $180^\circ - \theta_2$. 
A: No, I cannot see an elegant solution.
Take the $z$-axis vertically down, $x$-axis to the right along top of side roof, $y$-axis towards camera along top of main roof. The origin is where the two roof tops meet.
A point on the main sloping roof with $z=1$ has $x=\tan22.5^o$. A point on the side sloping roof with $z=1$ has $y=\tan20^o$. 
A unit vector along the side roof top is $(1,0,0)$. A vector down the join of the two roof tops is $(\tan22.5,\tan20,1)=(0.414214,0.36397,1)$, so a unit vector in that direction is $(0.362726,0.318727,0.875696)$. Their dot product is $0.362726$ so the acute angle between them is $\cos^{-1}0.362726$ and angle 1 is $180^o-\cos^{-1}0.362726=111.3^o$.
Similarly, angle 2 is $180^o-\cos^{-1}0.318727=108.6^o$.
