#include <stdio.h>
static double const G = 9.80665;
typedef struct tagXY {
double x;
double y;
} XY;
XY culcCordinates( double v0, double θ, double t ) {
double vx0 = v0 * ( 180 - θ ) / 180;
double vy0 = v0 * θ / 180;
double vx = vx0 + 0 * t;
double vy = vy0 + -G * t;
XY temp;
temp.x = vx * t;
temp.y = vy * t;
return temp;
}
int main() {
double v0 = 50;
double θ = 60;
double t = 0;
while ( true ) {
t += 0.01;
XY d = culcCordinates( v0, θ, t );
if ( d.y < 0 ) break;
printf( "%0.2f : ( %f, %f )\n", t, d.x, d.y );
}
}