Projectile motion

Need some help whit the following code:



void quadratic(int angle,int vel)
{

 float theta=3.14*angle/180;//angle to radians
 ux=vel*cos(theta);//X coord init value
 uy=vel*sin(theta);//Y coord init value

t=((vel*vel)*(2*(sin(theta)*cos(theta))))/9.8;//maximum range that projectile can reach

for(i=1;i<=t;i++)//nr of projectile (i=time) (t=distance to travel)
{

x=ux*i;//X coord value
y=uy*i+(0.5*(-9.8)*(i*i));//Y coord value

glVertex2f(x/50,y/50);
}

}

I’m trying to make a projectile motion just like that in pocket tank but i cant get it done.
For example its show a number of points but they don’t follow a quadratic trajectory and the points don’t stick whit equal distance between them.

Hi,

Here is a Wikipédia french link that speak about parabolic motion of a projectile http://fr.wikipedia.org/wiki/Trajectoire_parabolique

I think that the 9.8 constant is the gravity ?

Thanks for the link.I will try to look and I hope to fix it