/* Projectile Flight Functions Header File Author: J. Dalbey */ #include #define kPi 3.1415926535 /* Constant Pi */ #define kGravity 32.17 /* Gravitational constant */ /* Convert degrees to radians. angle in radians = angle in degres * Pi / 180 */ double degrees_to_radians(double degrees); /* input - degrees */ /* Calculate the time a projectile will be in flight until it reaches a given distance */ double calculate_time(double distance, /* input - distance to travel (ft) */ double velocity, /* input - initial velocity (ft/sec) */ double theta); /* input - initial angle (radians) */ /* Calculate the height a projectile will attain for a given time in flight */ double calculate_height(double velocity, /* input - initial velocity (ft/sec) */ double theta, /* input - initial angle (radians) */ double time); /* input - time in flight (secs) */ /* Calculate the horizontal distance traveled for a given time in flight */ double calculate_distance(double velocity, /* input - initial velocity (ft/sec) */ double theta, /* input - initial angle (radians) */ double time); /* input - time in flight (secs) */