Use the angle of dec to the base of B to find the distance to B
tan 21.8 = 40/x x = 100.00713 meters (note the 21 degrees 48 min is 21.8 decimal degrees)
Now use the angle of dec to the top
tan 12.5 = 40/x x = 180.4283 meters this is the distance line to the to the triangle vertex which the top intercepts
but the top is only 100.00713 meters away
(180.428-100.00713)/ 180.428 * 40 = 17.829 meters high = temple B
Check tan 12.5 = 17.829/80.428 ....check !