Firstly it must be understood that vertical and horizontal motion can be treated as independent, as they are perpendicular to each other (and acceleration due to gravity only affects the y component of velocity). So considering vertical forces, an acceleration of -g (-9.81ms-2) acts in the positive y direction. The vertical component of velocity can therefore be found with SUVAT (equations for constant acceleration). We know initial velocity in the positive y direction 'uy' = vsin(θ), acceleration 'a' = -g, time is known as 't' and we are trying to find vertical displacement 'y' (using y instead of the normal 's' for displacement), so we can use y=uyt + (1/2)at2=vsin(θ)t - (1/2)gt2.
We know everything in this expression apart from t, so using that the horizontal velocity is constant at ux=vcos(θ), use x=uxt + (1/2)at2=vcos(θ)t + (1/2)at2 , again where 'x' is horizontal displacement but where a=0 as there are no horizontal forces (so x=vcos(θ)t). Therefore we can rearrange for t=x/vcos(θ), then insert this into the y equation, so y=(vsin(θ)x)/vcos(θ) - (g/2)(x2/(vcos(θ))2), or more simply y=xtan(θ)-(g/2)(x/vcos(θ))2.