My enemy ships have cannons that rotate up and down around their x axis, with the barrels pointing down the z axis.
I am trying to use the typical Slerp statement that you would use to smoothly rotate an object from the current rotation to the target rotation. I usually use Slerp to rotate around the Y axis, but am trying to alter it to use the x axis. I'm trying to calculate the target rotation by using a formula to find the required angle to reach the distance of a target:

Here is my code:
var distance = Vector3.Distance(transform.position, target.position);
var reqAngle = .5*Mathf.Asin((gravityV*distance)/(bulletSpeed*bulletSpeed));
turretOne.transform.rotation = Quaternion.Slerp (turretOne.transform.rotation, Quaternion.LookRotation(targetDirection), TurretRotationSpeed * Time.deltaTime);
turretOne.transform.eulerAngles = Vector3(0, turretOne.transform.eulerAngles.y, 0);
cannonOne.transform.rotation = Quaternion.Slerp (cannonOne.transform.rotation, Quaternion.LookRotation(Vector3(reqAngle,targetDirection.y,0)), TurretRotationSpeed * Time.deltaTime);
cannonOne.transform.eulerAngles = Vector3(cannonOne.transform.eulerAngles.x, targetDirection.y, 0);
The Cannons are attached to the turret. The turrets can target the player character just fine, I left that code out. But I can get the cannons to adjust to the proper angle to shoot their projectiles the correct distance.
Thanks!