function Proj1()
{
var unknownVar;
unknownVar=prompt("Enter the unknown v, h or d you wish to calculate","");
if (unknownVar == "v") {
	h=prompt("Enter the height the projectile falls through.","");
	h=Number(h);
	d=prompt("Enter the horizontal range of the projectile.","");
	d=Number(d);
	v=d / (Math.sqrt(h/4.9));
	v=v.toPrecision(3);
	alert("The initial horizontal launch speed is "+v+"m/s.");
}
if (unknownVar == "h") {
	v=prompt("Enter the horizontal launch speed of the projectile.","");
	v=Number(v);
	d=prompt("Enter the horizontal range of the projectile.","");
	d=Number(d);
	h=4.9*d*d / (v*v);
	h=h.toPrecision(3);
	alert("The height projectile falls through is "+h+"m.");
}
if (unknownVar == "d") {
	v=prompt("Enter the horizontal launch speed of the projectile.","");
	v=Number(v);
	h=prompt("Enter the height the projectile falls through.","");
	h=Number(h);
	d=v * (Math.sqrt(h/4.9));
	d=d.toPrecision(3);
	alert("The horizontal range is "+d+"m.");
}
var TrueCalc;
TrueCalc=prompt("Do you want the true velocity at a given time? (y/n)","");
if (TrueCalc=="y") {
	t=prompt("At what time do you want the true velocity?","");
	vv=4.9*t;
	vt=Math.sqrt(v*v + vv*vv);
	vt=vt.toPrecision(3);
	angle=Math.atan(vv / v);
	angle=angle*180/3.14159;
	angle=angle.toPrecision(3);
	alert("The true velocity at "+t+"s is \n"+vt+"m/s at "+angle+" degrees above the horizontal.");
}
}
