Quant Library · Sports physics · Football, tennis, basketball
Ball Flight Solver
Drag, gravity and Magnus integrated properly, with a drag coefficient that changes through the crisis.
Fourth-order Runge-Kutta at two-millisecond steps, a speed-dependent drag coefficient per ball model, spin decay, wind and air density, with helpers for free kicks, serves and shots.
Inputs
4What it takes
| Name | Type | Units | Where it comes from |
|---|---|---|---|
| speed, elevation, azimuth | floats | m/s and degrees | your launch conditions |
| spin | float | rpm | side and top components |
| ball | object | mass kg, radius m, C_d curve | the catalogue, or your own measurements |
| air optional | floats | kg/m³, m/s | density from altitude and temperature; wind vector |
Outputs
3What it gives back
| Name | Type | Units | Notes |
|---|---|---|---|
| path | array of (t, x, y, z) | s, m | |
| crossing | position at a plane | m | the goal line, the service line, the rim |
| flight_time, peak | floats | s, m |
Method
How it works
- Integrate m dv/dt = mg − ½ρC_d A |v| v + ½ρC_l A |v|² (ω̂ × v̂) with RK4.
- 3 further steps in the licensed specification
Assumptions
- Smooth flow apart from the modelled crisis, a rigid ball, and no lateral wind shear along the flight.
Limits
- Near the crisis the real wake is unsteady, which is the knuckleball; a deterministic solver gives you the mean path and not the wobble.
- 1 further limits in the licensed specification
In the package
- The full specification: inputs, method, assumptions and limits
- The validation panel as measured on the day of purchase
- A reference implementation extracted from the running source
- Perpetual commercial use for one entity
Reference modules:
- 1 module(s), named in the licensed specification and shipped in the package
Read this before you buy. The platform's own walk-forward tests say the closing line forecasts football better than these models do. What they give you is a coherent price for every market and match, before the market opens, with the band and the working attached. Any model here that has been beaten by something simpler says so in its limits, and the validation panel above is generated from the platform's result files rather than typed in.