Math help in rotation

you can use findlookatrotation() and then use the zaw on the base and the pitch on the beam. clamping as needed