BASKETBALL — credits, sources and disclosures ============================================= WHAT THIS IS ------------ An independent, from-scratch reimplementation of basketball SHOOTING for the browser, written in plain JavaScript with a hand-written WebGL2 renderer and no third-party libraries. It is not affiliated with, endorsed by, sponsored by or connected to FIBA, the NBA, the NCAA, USA Basketball or any member federation, and it uses no code, art, audio or data from any other basketball game. THE ORIGINAL ------------ Basketball was invented by JAMES NAISMITH (1861-1939), a Canadian physical educator, at the International YMCA Training School in Springfield, Massachusetts, in DECEMBER 1891. He nailed a peach basket to the balcony rail of the gymnasium and wrote thirteen rules. The Fédération Internationale de Basketball (FIBA) was founded in 1932; the National Basketball Association in 1946. Nothing in this app is Naismith's text; the rules implemented here are the current editions of the modern governing bodies, cited by article below. WHAT THIS APP TAKES FROM THE RULEBOOKS, BY ARTICLE -------------------------------------------------- FIBA Official Basketball Rules — Basketball Equipment (2024 and 2026 editions carry identical text for all of the following except Art. 1.1.9, which is new in 2026): Art. 1.1.1 the board has a flat front surface; Level 1 glass is 11.8 to 13.5 mm Art. 1.1.3 backboard 1,800 mm (+30) horizontally by 1,050 mm (+20) vertically, with the frame Art. 1.1.4 board lines are 50 mm wide, white on a transparent board Art. 1.1.5 inner rectangle 590 mm (+20) by 450 mm (+8), OUTSIDE dimensions of the lines; the top edge of its base line is level with the top of the ring and 150 mm (-2) above the board's lower edge Art. 1.1.8 the board is mounted at right angles to the floor, parallel to the endlines, with its central vertical line meeting the floor 1,200 mm inside the endline Art. 1.1.9 (2026) a ball dropped onto the board from 1.8 m rebounds at least 50% Art. 1.2.1 ring inside diameter 450 to 459 mm; its metal 16 to 20 mm in diameter Art. 1.2.3 no force applied to the ring may be transferred to the backboard Art. 1.2.4 the ring's TOP EDGE is horizontal, 3,050 mm (+/-6) above the floor Art. 1.2.5 the nearest inside point of the ring is 151 mm (+/-2) from the board face Art. 1.2.7 pressure-release ring: releases between 82 and 105 kg of static load, rotates 10 to 30 degrees, returns automatically; the ring and support system absorb 35% to 50% of the impact energy, with opposing rings within 5 percentage points Art. 1.3.1 net 400 to 450 mm long on 12 loops, made "so that they check the ball momentarily as it passes through the basket" Art. 1.3.2 the net's upper section is semi-rigid so the ball cannot rebound back out Art. 1.4.3 the support is set back at least 2,000 mm from the endline (Level 1) Art. 1.5.3 the board's lower edge is padded 48 to 55 mm thick Art. 2.4 size 7 ball: 750 to 770 mm circumference, 580 to 620 g, maximum 12 seams; and THE INFLATION TEST — "dropped onto the floor from a height of approximately 1,800 mm measured from the underside of the ball, it shall rebound to a height of between 1,035 and 1,085 mm, measured to the underside of the ball" FIBA Official Basketball Rules 2026 (playing rules): Art. 2.1 court 28 by 15 m, inner edge to inner edge Art. 2.5 all lines are 5 cm wide Art. 2.5.2 free-throw semi-circle radius 1.80 m Art. 2.5.3 the free-throw line's furthest edge is 5.80 m from the inner edge of the endline; it is 3.60 m long Art. 2.5.4 the three-point arc has radius 6.75 m from the point on the court beneath the exact centre of the basket, measured to the OUTER edge of the arc, and that point is 1.575 m from the inner edge of the endline's mid-point; the two parallel lines have their outer edge 0.90 m from the sidelines; the line is not part of the 3-point area Art. 16.1.1 "A goal is made when a live ball enters the basket from above and remains within or passes through the basket entirely." Art. 16.1.2 "The ball is within the basket when the slightest part of the ball is within the basket and below the level of the ring." Art. 16.2.1 a free throw counts 1 point, a goal from the 3-point area counts 3, by where the shot was RELEASED Art. 44 the free throw. Art. 44.2.3: the shooter takes a position behind the line and inside the semi-circle, shoots so the ball enters from above OR touches the ring, releases within 5 seconds of the ball being placed at their disposal, does not touch the line until the ball has entered or touched the ring, and does not fake. (This was Art. 43 in the 2024 edition; FIBA inserted a new Art. 42 for 2026 and everything after it shifted by one.) NCAA Men's Basketball Rules Book: Rule 1 Sec. 16 Art. 7 the drop test, in the other convention: from 6 ft "measured to the bottom of the ball", rebounding "not less than 49 inches ... nor more than 54 inches, measured to the top of the ball" Rule 1 Sec. 15 Art. 4 the same 35%-50% ring energy absorption and 5% differential as FIBA NBA Official Rules: Rule 1 Sec. I the free-throw line is 15 ft "from the plane of the face of the backboard"; the three-point arc is 23'9" "from the middle of the basket" with parallel lines 3 ft from the sidelines Rule 1 Sec. II(a) backboard 6 ft by 3 1/2 ft Rule 1 Sec. II(e) the ring's upper edge is 10 ft above and parallel to the floor Rule 1 Sec. II(f) the nearest inside edge of the ring is 6 in from the board face Rule 1 Sec. II(h) the ball is inflated to 7 1/2 to 8 1/2 pounds pressure — and that is the ONLY ball clause. The NBA rulebook contains no drop test. NBA 2026 State Farm 3-Point Contest, official competition rules: eight players, two rounds; five racks of five balls at five locations on the arc; four racks hold four game balls (1 point) and one money ball (2 points) which "can only be shot after the four NBA game balls are shot"; a fifth all-money rack the competitor places; two "From the Logo" pedestals "six feet behind the three-point line" holding one blue money ball each, worth 3 points; 70 seconds for 27 balls. The 70-second limit, the 27 balls and the 40-point maximum date from the NBA press release of 4 February 2020, when the two deep balls were added and the maximum rose from 34 to 40. NBA HORSE Challenge, press release of 9 April 2020 — the only ruleset a governing body has ever published for HORSE, quoted in full in the app: a coin toss decides who shoots first, "players must describe each shot attempt, specifying the type of score they intend to make before taking a shot", dunking is prohibited, and five failures to match spells H-O-R-S-E. THE COEFFICIENT OF RESTITUTION IS DERIVED, NOT CHOSEN ----------------------------------------------------- No governing body publishes a coefficient of restitution for a basketball. Two of them publish a DROP TEST, and a drop test pins one — but only if you read the measurement convention correctly. FIBA (Equipment Art. 2.4) measures BOTH the drop and the rebound to the ball's UNDERSIDE. What obeys v^2 = 2gh is the centre of mass, and with the ball resting on the floor its centre is at r, released with its underside at H its centre is at H + r, and at the apex with its underside at h its centre is at h + r. So the fall of the centre is H and the rise is h — the ball's radius cancels — and e = sqrt(h/H): e = sqrt(1.035 / 1.800) = 0.7583 to sqrt(1.085 / 1.800) = 0.7764 The NCAA (Rule 1 Sec. 16 Art. 7) measures the drop to the BOTTOM and the rebound to the TOP. The fall of the centre is still H, but the rise is h_top - 2r — a whole DIAMETER comes out: e = sqrt((49in - d) / 72in) = 0.7402 to sqrt((54in - d) / 72in) = 0.7871 Corrected, the two agree and FIBA's band sits inside the NCAA's. Read the NCAA numbers naively, as if both were centre heights, and you get 0.825 to 0.866 — an 11% overstatement of the restitution and a 23% overstatement of the retained energy, which a player can see in one bounce. This app ships the midpoint of FIBA's band, e = 0.76739, and its harness drops that ball 1.800 m in the shipped integrator and checks it rebounds to 1,060 mm — inside FIBA's 1,035 to 1,085 mm. THE OPTIMAL FREE THROW, MEASURED AGAINST THE LITERATURE ------------------------------------------------------- Tran, C. M., & Silverberg, L. M. (2008). "Optimal release conditions for the free throw in men's basketball." Journal of Sports Sciences, 26(11), 1147-1155. doi:10.1080/02640410802004948. Larry M. Silverberg, "The math behind the perfect free throw", The Conversation, 2018. Okubo, H., & Hubbard, M. (2006). "Dynamics of the basketball shot with application to the free throw." Journal of Sports Sciences, 24(12), 1303-1314. Silverberg, L. M., Tran, C. M., & Adams, T. M. (2011). "Optimal Targets for the Bank Shot in Men's Basketball." Journal of Quantitative Analysis in Sports, 7(1). Barzykina, I. (2017). "The physics of an optimal basketball free throw." arXiv:1702.07234. Tran and Silverberg report a 52-degree launch, "up to 3 Hz" of backspin and an aim at the back of the ring ("the gap between the ball and the back of the ring should be less than 2 inches", which on a FIBA rim is 53.2 mm behind the centre), from a 2.134 m release. This app searched its OWN engine over launch angle, aim offset and backspin — 675 grid cells at 1,500 shots each, on common random numbers, then a spin sweep of 37 rates at 8,000 shots each — and found, at a stated release error of 1 degree in angle, 1% in speed and 0.5 degrees in yaw: launch angle 52 degrees (the paper: 52 degrees) release speed 7.27 m/s (the paper's derived figure: ~7.2 m/s) aim beyond centre 4 cm, flat 2-7 cm (the paper: at least 5.3 cm) backspin knee at 3 Hz (the paper: up to 3 Hz, "more does not help") The angle agrees exactly, the speed to 1%, and the aim within the width of the flat top. Backspin is where the accounts part, and the disagreement is small and specific: sweeping 0 to 9 Hz, the make probability climbs 74.8% to 82.7% between 0 and 3 Hz and the slope then falls by a factor of thirty-one, but it does not reach zero — a further 4.1 points arrive between 3 and 8 Hz. So Silverberg's mechanism and his number are right and his plateau is very nearly right; Okubo and Hubbard's "shots with larger backspin ... result in larger capture percentages" is right in the tail. Switching the Magnus force off entirely leaves most of the gain intact, which locates it: backspin works at the RIM, not in the air. WHAT THIS APP MEASURED FOR ITSELF --------------------------------- * The drag coefficient of a basketball is not 0.54 at shot speed. 0.54 is Okubo and Hubbard's free-fall estimate and Zhu et al. (iScience, 2026, wind tunnel on size 7 balls) find it agrees with measurement only BELOW 4 m/s. A basketball has a drag crisis at Re 6.9e4 to 8.9e4 — about 4.3 to 5.5 m/s — above which Cd "stabilizes between 0.3 and 0.4". This app uses the measured transition, not a constant, because a free throw crosses it on the way down. * Free-throw percentages, measured over 6,000 attempts per level: Rookie 49.0%, Pro 63.3%, Starter 77.0%, All-Star 89.5% — calibrated against published NBA figures (Curry .9120 and Nash .9043 at the top, the league near .78, O'Neal .5273 among regulars). * A rim RATTLE is chaotic. Two independent integrators agree on the frame of the first contact in every shot and on the verdict of every shot that resolves in two contacts or fewer, but a ball bouncing three or four times between near and far iron amplifies a difference of one part in 10^8 into a difference in the verdict. Refining both step sizes sixteenfold reconciles them. WHAT IS THIS APP'S OWN, AND SAID SO ----------------------------------- * THE NET. Art. 1.3.1 says the net "checks the ball momentarily" and says nothing about how hard. Here it is a linear damper of 4.2 per second inside a frustum tapering to 150 mm. A damper can only remove energy, which is what a limp cord can do; a spring could add it, which a cord cannot. RECONSTRUCTED. * RIM FRICTION (0.45) and BOARD FRICTION (0.25). No published measurement of a basketball's friction on a rim or on glass exists in the freely accessible literature. RECONSTRUCTED. * RIM RESTITUTION (0.60). Art. 1.2.7's 35-50% energy absorption implies 0.707 to 0.806, but that is a whole-system spec measured under a dunk-scale load, not a ball grazing iron. CALIBRATED below that band against the free-throw percentages above. * THE LIFT COEFFICIENT. No rotating-basketball wind tunnel exists — the 2026 study says so outright. The shape of Cl(S) here is the standard sports-ball form and only its SCALE is fitted, against Nikhilesh and Kulkarni's finding that lift adds 5 to 15 cm of height over a shot. This engine's figure is 7.3 cm. CALIBRATED. * AROUND THE WORLD and everything in HORSE beyond the NBA's four published rules: folk games, no governing body. The station set — six at 30-degree intervals with the middle one straight on — is the most widely described convention, and its asymmetry is the convention's. * THE DIFFICULTY LEVELS are three error standard deviations each, searched until the level's measured percentage lands on its anchor. They are measurements of this engine, not claims about players. * RELEASE HEIGHT 2.134 m (7 ft, the height Tran and Silverberg assume) and 180 mm of reach in front of the toe line. Where a ball leaves a hand is in no rulebook. * ALL COLOURS except the ball's orange (Art. 2.4) and the board's white lines (Art. 1.1.4). WHAT IS NOT SIMULATED --------------------- No defender, no dribble, no dunk, no rebound, no shot clock, no fouls, no officials. The pressure-release ring of Art. 1.2.7 never opens, because nothing in this app ever hangs on the rim. The backboard does not vibrate. The bracket between ring and board is drawn but not collided with, so Okubo and Hubbard's ball-bridge and ball-bridge-board contact cases do not arise. Art. 44's five-second limit and its line-touching rule are quoted but not enforced against the player. CODE, ART AND TOOLS ------------------- All code, all geometry and all art in this app were written for it. The renderer is hand-written WebGL2 with six primitives (box, plane, disc/annulus, cylinder, sphere, torus) and one draw call. The icons and the social card are drawn with PIL by a build script that ships with the source. The seeded random number generator is mulberry32, a public-domain 32-bit PRNG by Tommy Ettinger. Text in this file and in the app quotes short passages of the FIBA, NBA and NCAA rulebooks for the purpose of identifying and citing the rules implemented. Those rulebooks remain the property of their publishers. LICENCE ------- The app's own code and art are released under the MIT licence; see LICENSE.txt.