This is my current script in calculating the Y angle that I then use on CFrame.Angle() which works, But I am looking how I can also do the same but for X axis as I’m not familiar with roblox math functions but do know trigonometry in real life.

local Magnitude = (plr.Character.Head.Position - Target.Position).Magnitude
local Height = math.sqrt((plr.Character.Head.Position.Y - Target.Position.Y)^2)
local Sine = Height / Magnitude
local Angle = math.asin(Sine)
waist.C0 = waist.C0:Lerp(CFrame.Angles(Angle,0,0), 0.1)
--for value after angle I wanna find the X angle that I can rotate brick with