function ScreenSpace.GetDepthForWidth(h,f)local j=ScreenSpace.AspectRatio()local H=math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)local B=j*H local u,F=ScreenSpace.ViewSizeX(),ScreenSpace.ViewSizeY()return-(u*f)/((h*2)*B)end function ScreenSpace.GetDepthForHeight(h,f)local j=math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)local H=ScreenSpace.ViewSizeY()return-(H*f)/((h*2)*j)end
-- WorldSize + ScreenSize -> Depth needed
function ScreenSpace.GetDepthForWidth(screenWidth, worldWidth)
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView) / 2)
	local wfactor = aspectRatio * hfactor
	local sx, sy = ScreenSpace.ViewSizeX(), ScreenSpace.ViewSizeY()
	--
	return -(sx * worldWidth) / (screenWidth * 2 * wfactor)
end
function ScreenSpace.GetDepthForHeight(screenHeight, worldHeight)
	local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView) / 2)
	local sy = ScreenSpace.ViewSizeY()
	--
	return -(sy * worldHeight) / (screenHeight * 2 * hfactor)
end
