Calculator overview
Inputs and outputs
This summary comes from the calculator's published input and output contract.
Inputs
- Quadratic drag coefficient (1/m) (required)
-
Unit 1/m Default 0.005 Range 0 to 0.02
About this input
The quadratic drag coefficient c, from 0 to 0.02 per metre: the drag acceleration is c times the speed times the velocity. For a ball, c = air density x drag coefficient x frontal area / (2 x mass); a baseball is about 0.005. Used only with the Quadratic model.
- Your predicted range (m) (required)
-
Unit m Default 0 Range 0 to 20000
About this input
Your prediction of the range in metres, from 0 to 20000. Challenge 1 scores it; otherwise it is ignored.
- Linear drag rate (1/s) (required)
-
Unit 1/s Default 0.1 Range 0 to 1
About this input
The linear drag rate b, from 0 to 1 per second: the drag acceleration is b times the velocity. Used only with the Linear model.
- Search: highest angle (degrees) (required)
-
Unit deg Default 85 Range 1 to 89
About this input
The highest of the 21 launch angles the search tries, from 1 to 89 degrees, above the lowest.
- Target height (m) (required)
-
Unit m Default 0 Range 0 to 200
About this input
How high the target is, from 0 (on the ground) to 200 m.
- Target distance (m) (required)
-
Unit m Default 30 Range 1 to 2000
About this input
How far away the target is, from 1 to 2000 m, measured along the ground from the launcher.
- Search: lowest angle (degrees) (required)
-
Unit deg Default 5 Range 1 to 89
About this input
The lowest of the 21 launch angles the search tries, from 1 to 89 degrees.
- Gravity (m/s2) (required)
-
Unit m/s2 Default 9.81 Range 1 to 30
About this input
The downward acceleration, from 1 to 30 m/s2: Earth 9.81, Mars 3.71, the Moon 1.62.
- Air drag model (required)
-
Default None Allowed None, Linear, Quadratic
About this input
How air slows the ball: None (a vacuum), Linear (drag proportional to the velocity, as for tiny or slow particles) or Quadratic (drag proportional to the speed squared, as for a ball in air).
- Challenge number (required)
-
Default 0 Range 0 to 5
About this input
0 for free play; 1 to 5 load one of the five challenges, whose scenario then replaces the inputs it fixes.
- Hit radius (m) (required)
-
Unit m Default 0.5 Range 0.01 to 10
About this input
How close the shot must pass to the target to count as a hit, from 0.01 to 10 m, measured from the trajectory's closest approach to the target.
- Launch speed (m/s) (required)
-
Unit m/s Default 20 Range 1 to 100
About this input
How fast the ball leaves the launcher, from 1 to 100 m/s. With no drag the range from the ground grows with the square of the speed.
- Launch height (m) (required)
-
Unit m Default 0 Range 0 to 100
About this input
How high above the ground the ball starts, from 0 to 100 m. From a height the best angle for range drops below 45 degrees.
- Launch angle (degrees) (required)
-
Unit deg Default 30 Range 0 to 90
About this input
The launch direction above the horizontal, from 0 (flat) to 90 degrees (straight up). From the ground with no drag, 45 degrees gives the longest range.
Outputs
- Highest search angle solved (degrees)
-
Unit deg
About this output
The highest searched angle actually solved, in degrees.
- RK4 stage accelerations of each step
-
No unit declared
About this output
The four accelerations RK4 evaluates in each step (horizontal and vertical, in m/s2), one row per step from frame k to k + 1.
- RK4 range error (m)
-
Unit m
About this output
The RK4 range minus the exact range, in metres: how far the numerical method is from the exact answer. Exactly 0 with no drag, where RK4 follows the parabola exactly. Blank with quadratic drag.
- Signed miss (m; + above, - short or below)
-
Unit m
About this output
Which way the shot misses, in metres: above (+) or below (-) the target where it passes the target distance, or, when it lands short, how far short (-). The angle search brackets the hitting angles where this changes sign.
- Search step (degrees)
-
Unit deg
About this output
The spacing between the searched angles, in degrees.
- Lowest search angle solved (degrees)
-
Unit deg
About this output
The lowest searched angle actually solved, in degrees.
- Refined best angle (degrees)
-
Unit deg
About this output
An estimate of the best angle between the searched ones: the top of the parabola through the best candidate and its two neighbours, in degrees.
- Formula module versions
-
No unit declared
About this output
The versions of the formula modules this workbook is built from.
- Model version
-
No unit declared
About this output
The version of this workbook's model.
- Model Status
-
No unit declared
About this output
OK when the shot and every candidate landed, the best angle lies inside the search and some angle reaches the target. CHECK names a result that deserves attention: the best range at the edge of the searched angles, or no searched angle reaching the target. NOT VALID names the input to fix.
- Range lost to drag (m)
-
Unit m
About this output
How much range drag costs: the no-drag range minus the range, in metres. Exactly 0 with no drag.
- Range (m)
-
Unit m
About this output
How far the ball travels before it lands, in metres, from the RK4 trajectory and the landing found inside its last step.
- Quadratic drag coefficient in effect (1/m)
-
Unit 1/m
About this output
The quadratic drag coefficient in effect, in 1/m; 0 unless the Quadratic model is solved.
- Launch speed solved (m/s)
-
Unit m/s
About this output
The launch speed actually solved, in m/s: a challenge's given value, or yours.
- No-drag apex height (m)
-
Unit m
About this output
The highest point of the same launch with no drag, from the closed form, in metres.
- Trajectory frames computed by RK4 (the last used row is the impact)
-
No unit declared
About this output
The flight, one row per frame: the frame number, the time, the position x and y, the velocity vx and vy and the speed, from the RK4 steps up to the landing step; the last used row is the landing point. The page animates these rows exactly.
- Time step (s)
-
Unit s
About this output
The RK4 time step of the main trajectory, in seconds: the simulated window divided by 120.
- No-drag range (m)
-
Unit m
About this output
The range of the same launch with no drag, from the closed form, in metres.
- No-drag reference path
-
No unit declared
About this output
The same launch with no drag, 41 points from the closed form, to compare with the computed flight.
- No-drag flight time (s)
-
Unit s
About this output
The flight time of the same launch with no drag, from the closed form, in seconds.
- Target result
-
No unit declared
About this output
HIT when the shot passes within the hit radius of the target (its closest approach), SHORT when it misses and lands before the target distance, MISS when it misses otherwise.
- High-arc hitting angle, estimated (degrees)
-
Unit deg
About this output
An estimate of the high-arc angle that hits the target, in degrees: where the miss last changes sign. Equal to the low-arc estimate when it changes sign once.
- Target height solved (m)
-
Unit m
About this output
The target height actually solved, in metres.
- Target distance solved (m)
-
Unit m
About this output
The target distance actually solved, in metres.
- Closest approach to the target (m)
-
Unit m
About this output
How close the shot comes to the target, in metres: the shortest distance from the target to the drawn trajectory, including its landing point. Never negative; a hit is within the hit radius.
- Low-arc hitting angle, estimated (degrees)
-
Unit deg
About this output
An estimate of the low-arc angle that hits the target, in degrees: where the miss first changes sign between two neighbouring searched angles, by straight-line interpolation. Blank when the miss never changes sign.
- Candidate angles that hit
-
No unit declared
About this output
How many of the 21 searched angles hit the target.
- Challenge score
-
No unit declared
About this output
100 when the selected challenge is met, otherwise 0.
- Challenge goal
-
No unit declared
About this output
What the selected challenge asks.
- Challenge feedback
-
No unit declared
About this output
Whether the challenge is met, or a hint for what to try next.
- Closest candidate miss (m)
-
Unit m
About this output
The closest approach of the closest searched angle, in metres (never negative).
- Closest candidate angle (degrees)
-
Unit deg
About this output
The searched angle whose trajectory comes closest to the target, in degrees.
- Challenge result
-
No unit declared
About this output
No challenge selected, MET or NOT MET.
- Best angle for range (degrees)
-
Unit deg
About this output
The searched angle with the longest range, in degrees (the lowest angle on a tie).
- Apex distance (m)
-
Unit m
About this output
How far along the ground the highest point is, in metres.
- Launch angle solved (degrees)
-
Unit deg
About this output
The launch angle actually solved, in degrees.
- Angle search: 21 candidate trajectories
-
No unit declared
About this output
The angle search, one row per searched angle: the angle, the flight time, the range, the height where it passes the target distance, the miss (its closest approach to the target), the result (HIT, MISS or SHORT) and the signed miss (+ above, - below or short).
- Best range in the search (m)
-
Unit m
About this output
The longest range among the 21 searched angles, in metres.
- Apex time (s)
-
Unit s
About this output
When the ball reaches its highest point, in seconds after launch.
- Apex height (m)
-
Unit m
About this output
The highest point of the flight above the ground, in metres.
- Drag model solved
-
No unit declared
About this output
The drag model actually solved.
- Hit radius solved (m)
-
Unit m
About this output
The hit radius actually solved, in metres.
- Launch height solved (m)
-
Unit m
About this output
The launch height actually solved, in metres.
- Height at the target distance (m)
-
Unit m
About this output
The height of the shot where it passes the target distance, in metres; blank when the shot lands short.
- Linear drag rate in effect (1/s)
-
Unit 1/s
About this output
The linear drag rate in effect, in 1/s; 0 unless the Linear model is solved.
- Impact speed (m/s)
-
Unit m/s
About this output
The speed at landing, in m/s. With no drag from the ground it equals the launch speed; drag makes it smaller.
- Impact angle below horizontal (degrees)
-
Unit deg
About this output
The angle of descent below the horizontal at landing, in degrees.
- Gravity solved (m/s2)
-
Unit m/s2
About this output
The gravity actually solved, in m/s2.
- Flight time (s)
-
Unit s
About this output
How long the ball is in the air, in seconds.
- Exact range (m)
-
Unit m
About this output
The exact range from the closed-form solution, in metres: the no-drag formula, or the exact linear-drag solution. Blank with quadratic drag, which has no closed form.
- Exact flight time (s)
-
Unit s
About this output
The exact flight time from the closed-form solution, in seconds; blank with quadratic drag.
- Simulated window (s)
-
Unit s
About this output
The simulated time window, in seconds: the flight-time estimate plus 2%.
- Frames
-
No unit declared
About this output
How many rows of the trajectory frames are used: the RK4 frames up to the landing step, plus the landing point.
- Flight-time estimate (s)
-
Unit s
About this output
The flight-time estimate the window is built from, in seconds: exact with no drag and with linear drag, a guaranteed upper bound with quadratic drag.
LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.
Methodology
Purpose and model boundary
This lab launches a ball as a point mass under constant gravity, with no air drag, linear drag or quadratic drag, and follows its flight with the classical fourth-order Runge-Kutta method (RK4) in 120 time steps. For the launch you set it returns the range, the flight time, the highest point, the impact speed and angle, and whether the shot hits a target you place. A search over 21 launch angles, each solved as its own trajectory, finds the angle with the longest range and estimates the angles that hit the target. With no drag and with linear drag the model also computes the exact answer, so you can see how far RK4 is from it. Five scored challenges turn the lab into exercises.
It is a lab for learning numerical integration and projectile motion, not a tool for aiming anything real. The air is still, the drag coefficient is constant and the ball does not spin; there is no wind, lift, buoyancy, varying air density, uneven ground, moving target or obstacle. The angle search tests 21 angles only: its best angle is the best of those, not a proven optimum.
The model is the calculation authority. The page sends the values you set to the model and draws only what the model returns: every trajectory point, velocity arrow, candidate path and the no-drag path comes from the model's results; the page computes no physics value itself.
Inputs and units
| Input | Meaning and unit |
|---|---|
| Launch speed | How fast the ball leaves the launcher, from 1 to 100 m/s. |
| Launch angle | The launch direction above the horizontal, from 0 (flat) to 90 degrees (straight up). From the ground the angle must be above 0. |
| Launch height | How high above the ground the ball starts, from 0 to 100 m. |
| Gravity | The downward acceleration g, from 1 to 30 m/s²: Earth 9.81, Mars 3.71, the Moon 1.62. |
| Air drag model | None (a vacuum), Linear (drag proportional to the velocity) or Quadratic (drag proportional to the speed times the velocity). |
| Linear drag rate | b, from 0 to 1 per second (1/s): the drag acceleration is b times the velocity. Used only with the Linear model. |
| Quadratic drag coefficient | c, from 0 to 0.02 per metre (1/m): the drag acceleration is c times the speed times the velocity. For a ball, c = air density × drag coefficient × frontal area / (2 × mass); a baseball is about 0.005. Used only with the Quadratic model. |
| Target distance | How far away the target is along the ground, from 1 to 2,000 m. |
| Target height | How high the target is, from 0 (on the ground) to 200 m. |
| Hit radius | How close the shot must pass to the target to count as a hit, from 0.01 to 10 m. |
| Search: lowest angle | The lowest of the 21 searched launch angles, from 1 to 89 degrees. |
| Search: highest angle | The highest of the 21 searched launch angles, from 1 to 89 degrees, above the lowest. |
| Challenge number | 0 for free play; 1 to 5 loads one of the five challenges. |
| Your predicted range | Your guess at the range before you look, from 0 to 20,000 m. Only challenge 1 scores it; otherwise it is ignored. |
Sign conventions: x is measured to the right along the ground from the launcher, and y is up, with the ground at y = 0. The launch point is (0, launch height) and the target is the fixed point (target distance, target height). Angles are in degrees above the horizontal; the impact angle is measured below the horizontal. Velocities are positive to the right and up, so a falling ball has a negative vy.
Where each input is set: every input is in the input panel. Several can also be set directly on the canvas by dragging:
- the launch arrow's tip sets the launch angle (its direction) and the launch speed (its length);
- the lift handle at the launcher sets the launch height;
- the target sets the target distance and height;
- in challenge 1, a flag sets your predicted range;
- in the Experiment and Advanced views, with the angle search shown and no challenge selected, two shorter arrows set the lowest and highest search angles;
- a marker on the angle-search chart sets the launch angle.
In a challenge, the inputs the challenge fixes cannot be changed.
Governing relationships
The motion. The ball starts at (0, h) with velocity vx₀ = v cos θ and vy₀ = v sin θ. Drag opposes the velocity:
- aₓ = −(b + c·S)·vx
- a_y = −g − (b + c·S)·vy, with the speed S = √(vx² + vy²)
Only the drag model you choose is in effect: b is the linear rate when the model is Linear and 0 otherwise, and c is the quadratic coefficient when the model is Quadratic and 0 otherwise. With b = 0 and c = 0 the flight is a vacuum flight, whatever the dropdown says. The acceleration depends only on the velocity, never on the position.
One RK4 step. From a frame (t, x, y, vx, vy) with step Δt, the model evaluates the acceleration four times: (a1) at the start; (a2) at the velocity half a step ahead along a1; (a3) at the velocity half a step ahead along a2; and (a4) at the velocity a full step ahead along a3. The new frame is
- x′ = x + Δt/6 · (vx + 2·v2x + 2·v3x + v4x), and the same for y;
- vx′ = vx + Δt/6 · (a1x + 2·a2x + 2·a3x + a4x), and the same for vy;
- t′ = k′·Δt, the step number times the step, never a running sum.
With no drag the acceleration is constant and RK4 is exact: every frame lies on the closed-form parabola.
The time window. The 120 steps are spread over a window that must hold the whole flight. The model first estimates the flight time T_est from the launch:
- With no drag it is exact: T_est = (vy₀ + √(vy₀² + 2gh)) / g.
- With linear drag it is also exact. The model takes 8 Newton steps on the exact height equation, h + (vy₀ + g/b)(1 − e^(−bt))/b − (g/b)·t = 0, from a starting time that is known to be after the landing.
- With quadratic drag there is no closed form, so the model builds a guaranteed upper bound on the flight time from closed-form bounds on the ascent and the fall, finished with 6 Newton steps.
The window is W = T_est × 1.02 and the step is Δt = W / 120. With quadratic drag the bound is generous, so the ball can land well before the 120th step.
Events inside a step. The landing, the highest point and the moment the ball passes the target distance are each found inside the one RK4 step where they happen, never by a straight line between frames. The model uses the cubic Hermite curve through the step's two end frames, built from each quantity and its rate of change (position with velocity, velocity with acceleration). It solves for the event with 4 Newton steps on that curve, kept inside the step, starting from the straight-line estimate:
- the landing is where y = 0 in the first step that ends at or below the ground;
- the highest point is where vy = 0, or the launch point when the ball starts level or downward;
- the target crossing is where x equals the target distance.
The range, the flight time and the impact velocity are read from the curve at the landing.
Hit or miss. The trajectory drawn is the line through the RK4 frames up to the landing step and then the landing point. The closest approach is the shortest straight-line distance from the target to that line, segment by segment, in closed form. The verdict follows from it:
- HIT when the closest approach is at most the hit radius;
- otherwise SHORT when the ball lands before the target distance;
- otherwise MISS.
The signed miss says which way the shot misses. When the ball passes the target distance before it lands, it is the height there minus the target height (positive above, negative below). When the ball lands short, it is the range minus the target distance (negative).
The angle search. The 21 candidate angles are evenly spaced from the lowest to the highest search angle, θⱼ = θ_min + (j − 1)·(θ_max − θ_min)/20. Each candidate uses the same speed, height, gravity and drag, its own flight-time estimate and window, and 40 RK4 steps. Its landing and target result follow the same rules.
- The best angle for range is the candidate with the longest range, the lowest angle on a tie.
- The refined best angle is the top of the parabola through the best candidate and its two neighbours: θᵢ + (Δ/2)·(R₍ᵢ₋₁₎ − R₍ᵢ₊₁₎) / (R₍ᵢ₋₁₎ − 2Rᵢ + R₍ᵢ₊₁₎), for the angle spacing Δ. It is θᵢ itself when the best is the first or last candidate or the denominator is 0. It is an estimate, not a solved trajectory.
- The low-arc and high-arc hitting angles come from the signed miss. Over neighbouring candidates that both landed, the model finds the first and the last pair where the signed miss changes sign. It interpolates each in a straight line, θⱼ + (θⱼ₊₁ − θⱼ)·mⱼ / (mⱼ − mⱼ₊₁). The two are equal when there is only one sign change, and blank when there is none.
Exact and no-drag references. The no-drag range, flight time and apex height of the same launch come from the closed form: T_v = (vy₀ + √(vy₀² + 2gh))/g, range vx₀·T_v, and apex h + vy₀²/(2g). The no-drag path is 41 points of that parabola, evenly spaced in time.
The exact range and flight time come from the drag in effect. With no drag they are the no-drag values. With linear drag the exact flight time is the Newton result above, and the exact range is vx₀·(1 − e^(−bT))/b. With quadratic drag they are blank, because that model has no closed form. The RK4 range error is the RK4 range minus the exact range.
Calculation sequence
The model works through the relationships above in this order:
- It checks the entered inputs in the order of the status list under Errors and warnings, up to the challenge number.
- It fixes the scenario solved: your inputs, or in a challenge the challenge's givens. It then checks that a launch from ground level has an angle above 0. Under NOT VALID every result is blank.
- It estimates the flight time and sets the window W = T_est × 1.02 and the step Δt = W / 120.
- It takes the 120 RK4 steps of the main trajectory, recording each frame and the four stage accelerations of each step.
- It finds the landing, the highest point and the target crossing on the Hermite curve of their steps, and reads the range, the flight time and the impact velocity at the landing.
- It finds the closest approach to the target, the verdict HIT, MISS or SHORT, and the signed miss.
- It computes the no-drag references, the exact solution where there is one, and the RK4 range error.
- It solves the 21 candidate angles, each with its own window and 40 steps, then the best angle, the refined best angle and the estimated hitting angles.
- It sets the status and, in a challenge, scores the challenge.
Outputs and interpretation
- Status: OK, CHECK or NOT VALID, with the reason (see Validation and status logic and Errors and warnings).
- Flight: the range (m), the flight time (s), the apex height, distance (m) and time (s), the impact speed (m/s) and the impact angle below the horizontal (degrees). With no drag from the ground the impact speed equals the launch speed; drag makes it smaller.
- Target:
- the target result, HIT, MISS or SHORT;
- the closest approach to the target (m, never negative);
- the signed miss (m; + above, − below or short);
- the height of the shot at the target distance (m), blank when the shot lands short.
- No-drag comparison: the no-drag range, flight time and apex height, and the range lost to drag (the no-drag range minus the range).
- Exact solution: the exact range and flight time, and the RK4 range error, read in scientific notation because it is tiny (exactly 0 with no drag). All three are blank with quadratic drag.
- Angle search:
- the best searched angle for range and its range, and the refined best angle;
- the search step (degrees) and the number of candidate angles that hit;
- the closest candidate angle and its closest approach;
- the estimated low-arc and high-arc hitting angles.
- Numerical details: the frame count, the time step (s), the simulated window (s) and the flight-time estimate it is built from (s).
- Scenario solved: the speed, angle, height, gravity, drag model, drag rate and coefficient in effect (0 unless that model is solved), target distance and height, hit radius and search angles actually solved. In a challenge these are the challenge's givens.
- Grids:
- Trajectory frames: up to 121 rows of frame, time, x, y, vx, vy and speed. The rows hold the RK4 frames up to the landing step, and the last used row is the impact itself: its time is the flight time, its x the range, its y = 0, and its time step is shorter than the others. Rows after it are blank.
- RK4 stage accelerations: the four horizontal and vertical accelerations of each step, in m/s², one row per step from frame k to k + 1.
- Angle search: 21 rows of angle, flight time, range, height at the target distance, miss (closest approach), result and signed miss. A candidate that did not land shows only its angle and SHORT.
- No-drag path: 41 points of x and y.
The page animates the trajectory frames exactly as returned, draws the RK4 stage arrows, the candidate fan and the no-drag path from these grids, and draws nothing past the used rows.
Reading the results:
- With no drag, the range, flight time and apex match the closed form to rounding, and the range lost to drag and the RK4 range error read exactly 0: with no drag the RK4 steps and the landing interpolation follow the parabola exactly. Straight up (90°) the range, the apex distance and every x read exactly 0, because the model sets the horizontal launch speed to 0 at 90° (cos 90° is not exactly 0 in floating point).
- A candidate's range can differ in the last digits from the main shot's at the same angle, because the candidates take 40 steps and the main shot 120.
- For a target on the ground, the estimated hitting angles sit a few tenths of a degree above the true ones. Each estimate interpolates between a short candidate's horizontal miss and a reaching candidate's vertical miss.
Challenges
Choose a challenge number from 1 to 5. The model loads that challenge's scenario, and the inputs it fixes replace yours (the "solved" outputs show the values in effect). Only the inputs the challenge leaves free stay yours. The challenge result reads MET or NOT MET, the score is 100 when met and 0 otherwise, and a goal and a feedback line say what is asked and what to try next.
- Predict the vacuum range. Enter your predicted range for a given launch with no drag before you look; a prediction within 2% of the computed range scores.
- Hit a target on the ground. At a given speed, choose a launch angle that hits a target on the ground.
- Hit it with the least speed. Choose a speed and an angle that hit a raised target with a launch speed of at most 19 m/s.
- The best angle with drag. With quadratic drag, choose a launch angle whose range is at least 99.5% of the best range in the angle search.
- A raised target with drag. Launching from a height with quadratic drag, choose a launch angle that hits a raised target.
Validation and status logic
The status reads the first message in the list under Errors and warnings that applies: the NOT VALID input
checks first, then the CHECK items, then OK. OK means the shot and every candidate landed, the best angle
lies inside the search, and some angle reaches the target. A CHECK still returns every result; it marks one
that deserves a second look.
Assumptions and limitations
- Point mass, flat ground at y = 0, constant gravity, still air; one drag law at a time, with a constant coefficient. No wind, spin, lift, buoyancy or varying air density; the target is a fixed point.
- The main trajectory takes 120 RK4 steps over a window of 1.02 times the flight-time estimate (121 frame rows and 120 stage rows). Each of the 21 candidates takes 40 steps. The no-drag path has 41 points.
- Event times and positions come from the cubic Hermite curve inside the event's step after 4 Newton steps, and carry that curve's small error, not a closed form's.
- The refined best angle and the hitting angles are estimates between searched angles; replaying an angle gives its true result. The best searched angle is not claimed to be the global optimum.
- A value within about 1×10⁻⁹ of a threshold, such as a tie between two candidates or a miss exactly equal to the hit radius, may round either way.
Restrictions and non-computing states
Every input is required; a blank or out-of-range value reads NOT VALID.
Under NOT VALID every result is blank and a selected challenge reads NOT MET with a score of 0. Every number and grid is blank (the counts read 0); the version texts and the challenge result still show.
Errors and warnings
The status messages, in the order they are checked:
NOT VALID: the launch speed must be from 1 to 100 m/sNOT VALID: the launch angle must be from 0 to 90 degreesNOT VALID: the launch height must be from 0 to 100 mNOT VALID: gravity must be from 1 to 30 m/s2NOT VALID: choose a drag model from the listNOT VALID: the linear drag rate must be from 0 to 1 per second and the quadratic drag coefficient from 0 to 0.02 per metreNOT VALID: the target distance must be from 1 to 2000 m, its height from 0 to 200 m and the hit radius from 0.01 to 10 mNOT VALID: the search angles must be from 1 to 89 degrees, the lowest below the highestNOT VALID: the challenge number must be a whole number from 0 to 5 and the predicted range from 0 to 20000 mNOT VALID: from ground level the launch angle must be above 0: the scenario solved starts at height 0 and angle 0.CHECK: the shot or a candidate angle did not land within its simulated windowCHECK: the best range is at the edge of the searched angles, so the best angle may lie outside them: the best candidate is the first or the last searched angle. From a cliff, for example, the true best angle can lie below the lowest searched angle.CHECK: no searched angle reaches the target distance: no candidate passes the target distance before landing and none hits.OK: the shot and every candidate landed, the best angle lies inside the search, and some angle reaches the target.
References
This laboratory is an educational model of a point mass moving under constant gravity, with no air drag, linear drag or quadratic drag. The classical fourth-order Runge-Kutta method (RK4) advances the velocity and position over fixed time steps. The landing point, the highest point and the moment the shot passes the target are located inside a step on the cubic Hermite curve through its two ends, refined by Newton steps. The angle search runs the same model at evenly spaced launch angles. With no drag and with linear drag, the exact solutions check the numerical trajectory.
Sources and further reading
- Projectile motion without air resistance, the closed forms for range and flight time: S. J. Ling, J. Sanny and W. Moebs, University Physics Volume 1, OpenStax, 2016, section 4.3, Projectile Motion. OpenStax
- Projectiles with linear and quadratic air resistance, and the exact solution with linear drag: J. R. Taylor, Classical Mechanics, University Science Books, 2005, chapter 2, Projectiles and Charged Particles. WorldCat
- The classical fourth-order Runge-Kutta method: W. H. Press, S. A. Teukolsky, W. T. Vetterling and B. P. Flannery, Numerical Recipes: The Art of Scientific Computing, 3rd edition, Cambridge University Press, 2007, chapter 17, Integration of Ordinary Differential Equations, section 17.1, Runge-Kutta Method.
- Newton's method, Hermite interpolation and Runge-Kutta methods: R. L. Burden, J. D. Faires and A. M. Burden, Numerical Analysis, 10th edition, Cengage Learning, 2016, chapter 2, Solutions of Equations in One Variable, chapter 3, Interpolation and Polynomial Approximation, and chapter 5, Initial-Value Problems for Ordinary Differential Equations.
No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.
This laboratory is for learning. Its results hold only within its stated ranges; it is not a ballistics, sports or safety tool.
Found a problem, or have an idea?
Tell us if a result looks wrong, a label is unclear, or something is missing. We read every message.