Saturday, May 26, 2012

GeekDad Puzzle of the Week Answer: That Darn Achilles

That Darn Achilles:
Q: You, Paris, have the luxury of launching an arrow at faraway Achilles either from the ramparts above the Hesperian Gate at a height of exactly 8 meters. Or you can stand atop Priam’s palace. This gains you another 7 meters of launch height, but it costs you 15 meters of horizontal distance. If the arrow leaves your bow at a somewhat modest 70 meters per second, are you best taking your pot-shot at far-off Achilles from the ramparts or the palace? Which perch offers the farthest reach? I had to look up the formulas for determining the maximum range of a projectile when fired on uneven ground. The following page was invaluable.
Wikipedia: Range of a Projectile

Because several things weren't stated, I'm going to assume that we can use acceleration of gravity (g) at sea level, we can assume no wind resistance and also assume that the ground is level between the target and the firing point (except for the elevation change and horizontal offset provided by the ramparts (0,8) and the palace (-15, 15).

While the ideal case (firing on even ground) results in an optimal angle of 45°, when you are firing from a height, then you want to angle down slightly to maximize distance. I won't bore you with going through the details on that page, but basically there's an equation for the horizontal and vertical positions at time t, given an initial angle (theta) and velocity v. You can then set the final height to be 0 and solve for t. Using that you can get an equation for distance given an angle and by taking the derivative and setting it to zero, you can get a formula for the optimal angle to get the longest distance.

Rampart (x0,y0) = (0,8)
Palace (x0,y0) = (-15,15)
Velocity (v) = 70 m/s
Gravity (g) = 9.80665 m/s^2

Optimal angle (θ) = cos-1 [ √(2*g*y0 + v^2) / (2*g*y0 + 2v^2) ]

Rampart angle (θ) = 0.777519 Radians or 44.54853°
Palace angle (θ) = 0.7708234 Radians or 44.164927°
Distance (d) = [ v*cos θ [v*sin θ + √((v*sin θ)^2 + 2*g*y0) ] /g + x0

Rampart distance = 507.5979m
Palace distance = 499.44231m

A: When firing from the ramparts (8m), the optimal angle is around 44.55° and will net you a distance of 507.6 meters.

When firing from the palace (15m), the optimal angle is around 44.16° but because of the -15m offset you only reach 499.4 meters.