I have been tasked with trying to find a launch angle for a pumpkin launcher for a competition with a club at school! I am given the following data in a table and my goal is to find the launch angle to achieve a certain range given a distance and weight.
Basically I have written the program to obtain the two tables, the lower and upper weight tables. (There are many different tables based on the weight, I currently just wrote out the two that correspond to the weight of the pumpkin).
The lower weight represents the data I have for the closest weight below the target pumpkin, and upper weight data represents data I have for the closest weight above the target pumpkin.
Given these two tables I then grab the two angles that are above and below the target range for each of the weight tables.
So given the following information, how do I solve for theta given a weight I don't have a table for.
I am given the weight and Target distance, and the weight above and below of the given weight, and the corresponding angles. Basically everything on the left is given.
The pencil represents actual values for the problem from the table in the top right.
Input: target_weight (weight of the launched pumpkin), target_distance (how far we want the pumpkin to go)
Extracted:
- lower_weight = the table generated by the lower weight pumpkin
- upper_weight = the table generated by the upper weight pumpkin
- lower_weight_lower_angle = the angle whose distance is below the target
- lower_weight_lower_angle = the angle whose distance is above the target
- upper_weight_lower_angle = the angle whose distance is below the target
- upper_weight_lower_angle = the angle whose distance is above the target
Tables:
$$\large\begin{array}{cc} {2\:\text{lbs}}\over {\begin{array}{c|c} 10^\circ & 274\:\text{ft} \\ \hline 15^\circ & 328\:\text{ft} \\ \hline 20^\circ & 366\:\text{ft} \\ \hline 25^\circ & 390\:\text{ft} \\ \hline 30^\circ & 404\:\text{ft} \\ \hline 35^\circ & 410\:\text{ft} \end{array}} & {3\:\text{lbs}}\over{\begin{array}{c|c} 10^\circ & 284\:\text{ft} \\ \hline 15^\circ & 353\:\text{ft} \\ \hline 20^\circ & 404\:\text{ft} \\ \hline 25^\circ & 440\:\text{ft} \\ \hline 30^\circ & 462\:\text{ft} \\ \hline 35^\circ & 473\:\text{ft} \end{array}} \end{array}$$
Output: launch_angle (angle necessary to launch the specific weight pumpkin a certain distance)
Example:
Input:
- 2.5 lbs
- 400 ft
Output:
- launch_angle
lower_weight = 2 lbs
- lower_weight_lower_angle = 25$^\circ$
- lower_weight_upper_angle = 30$^\circ$
upper_weight = 3 lbs
- upper_weight_lower_angle = 15$^\circ$
- upper_weight_upper_angle = 20$^\circ$
$\large\star$ 8 variables: 2 input, 6 generated
