It is known to us that the Eqyptian pyramids have a square-shaped base and four sides which are equilateral triangles. The angles formed between the edge of the base and the equilateral side is 90°, thus, we can clearly apply the pythagorean theorem.
This is the rule for any calculation of this type. Note that you can replace X(B) by X(A) and the same for Y because the answers are squared and you'll always get the same value
The sum of angles in a triangle is 180 drgrees. From the picture I see that in the triangle UVW has angle U =90 degees, angle V=71 degrees so W= 180-90-71= 19 drgrees