#include <stdio.h>
#include <math.h>

int main(void){
	float xVelocity;
	float yVelocity;


	//printf("Please enter the x velocity in meters per second: ");
	//scanf("%f",&xVelocity);
	//printf("Please enter the y velocity in meters per second: ");
	//scanf("%f", &yVelocity);

	float angle;
	float magnitude;
	printf("Please enter the angle from the horizontal, in radians: ");
	scanf("%f",&angle);
	printf("Please enter the magnitude of the force vector: ");
	scanf("%f",&magnitude);
	xVelocity = magnitude * cos(angle);
	yVelocity = magnitude * sin(angle);
	printf("Initial x velocity is: %.2f meters per second\n",xVelocity);
	printf("Initial y velocity is: %.2f meters per second\n",yVelocity); 	


	float timeToFly;
	timeToFly = 2 * yVelocity / 9.8;

	float distanceFlown;
	distanceFlown = timeToFly * xVelocity;

	printf("The time the bird will take to fly is: %.2f seconds",timeToFly);
	printf("\nThe distance the bird will fly is: %.2f meters",distanceFlown);

	/*
	int nSeconds;
	for (nSeconds = 1; nSeconds < timeToFly; ++nSeconds){
		float distance;
		distance = nSeconds * xVelocity;
		printf("\nAt t=%d, the x position of the bird will be: %.2f meters",nSeconds,distance);

	}
	*/

	return 0; 
}
