function [ dist ] = throwBall( v, phi )
%THROWBALL Summary of this function goes here
%   Detailed explanation goes here

h = 1.5;
g = 9.8;
t = 0:.001:10;
x = v*cos(phi*pi/180).*t;
y = h + v*sin(phi*pi/180).*t-0.5*g.*t.^2;
dist = find(y<0);
if size(dist,2) == 0
    disp('A labda nem esett le')
    dist = NaN;
else
    dist= x(dist(1));
end
plot(x,y)

end

