--[[
	
	Calculates angle of reach  distance, altitude, velocity)
	
	Functions.AngleOfReach(
		distance,				<-- |REQ| 	Distance
		altitude,				<-- |REQ| 	Altitude
		velocity,				<-- |REQ| 	Velocity
	)
		
--]]



return function(distance, altitude, velocity)
	local gravity = game.Workspace.Gravity
	
	--
	local theta = math.atan((velocity ^ 2 + math.sqrt(velocity ^ 4 -gravity * (gravity * distance ^ 2 + 2 * altitude * velocity ^ 2))) / (gravity * distance))
	
	--
	if theta ~= theta then
		theta = math.pi/4
	end
	
	--
	return(theta)
end
