function angleBetweenPoints(S,w)local J=S-w return-math.atan2(J.z,J.x)end function getCameraAngle(S)local w,J=S.CoordinateFrame,S.Focus return angleBetweenPoints(w.p,J.p)end
-- Helper functions

function angleBetweenPoints(p0, p1)
	local p = p0 - p1
	return -math.atan2(p.z, p.x)
end

function getCameraAngle(camera)
	local cf, f = camera.CoordinateFrame, camera.Focus
	return angleBetweenPoints(cf.p, f.p)
end
