How do you make the present script depend on angle?

So I have a small script where t is time, v0 is starting velocity, x0 is starting position. As seen in the video, everything works pretty fine

wait(3)

for i = 1, 2, 0.5 do	
	local ball = workspace.Ball:Clone()
	ball.CFrame = workspace.Ball.CFrame
	ball.Parent = workspace
	ball.Transparency = 0

	local t = i
	local Target = workspace.Target

	local g = Vector3.new(0, -game.Workspace.Gravity, 0)
	local x0 = ball.Position

	local v0 = (Target.Position - x0 - 0.5*g*t*t)/t

	ball.WeldConstraint:Destroy()
	ball.AssemblyLinearVelocity = Vector3.new(v0.X, v0.Y, v0.Z)

	task.wait(3)
end

But what I want to do is to change the script so it depends on angle instead of time