TABLE TENNIS An independent implementation. https://table-tennis.skillsafe.ai/ ================================================================================ WHAT THIS IS ================================================================================ Table tennis is a sport, not a work of authorship: nobody owns it, and this is not a copy of anybody's game. What it IS built from is a published specification. The International Table Tennis Federation prints the Laws of Table Tennis as exact numbers, and a small body of peer-reviewed work has measured how a 40 mm ball actually flies and bounces. This app is built to both, and everything below says which of its numbers came from where. There is no affiliation with, endorsement by, or connection to the ITTF, any national association, or any equipment manufacturer. A note on the name. "Ping-Pong" is a live trademark - it has been privately owned since the turn of the twentieth century and in the United States it is currently held by Indian Industries, Inc. (trading as Escalade Sports). "Table tennis" is the sport's own name, the name of its governing body, and the name used throughout this app, deliberately. ================================================================================ THE RULES AND THE EQUIPMENT: FROM THE LAWS, BY CLAUSE ================================================================================ Source: ITTF Statutes, Chapter 2, "The Laws of Table Tennis". The clause text was read from the official PDF. The 2025 and 2026 editions are byte-identical in Chapter 2, so every clause quoted here is current. https://cdn.megaspin.net/rules/pdf/2026/ittf-rules-2.pdf https://www.ittf.com/statutes/ (the canonical home of the Statutes) 2.1.1 The playing surface is 2.74 m long and 1.525 m wide, in a horizontal plane 76 cm above the floor. 2.1.2 The vertical sides of the tabletop are not part of the playing surface. (The app models them separately, and a ball that hits one is not a good return.) 2.1.3 The surface "shall yield a uniform bounce of about 23 cm when a standard ball is dropped on to it from a height of 30 cm". This is the single most useful number in the whole document, because it pins the coefficient of restitution: e = sqrt(23/30) = 0.8756, with no dependence on g at all, at an impact speed of 2.426 m/s. 2.1.4 White side and end lines, 2 cm wide, on a uniformly dark, matt surface. 2.1.6 A white centre line 3 mm wide, for doubles. It is drawn, though this app plays singles only. 2.2.2 The net posts are 15.25 cm high and their outside limits are 15.25 cm outside each side line. 2.2.3 The top of the net is 15.25 cm above the playing surface. 2.2.4 The net reaches the surface and is attached to the posts top to bottom - which is why a ball can never pass under or beside it, only over it or round the outside of a post. 2.3.1 The ball is 40 mm in diameter. 2.3.2 It weighs 2.7 g. 2.3.3 It is plastic, white or orange, and matt. (The word "celluloid" was in this clause until the material change of 2014; it is gone now.) 2.4.1 "The racket may be of ANY SIZE, SHAPE OR WEIGHT but the blade shall be flat and rigid." So every dimension of the racket in this app is the app's own choice - see RECONSTRUCTED below. 2.4.2 At least 85% of the blade by thickness is natural wood. 2.4.3 Ordinary pimpled rubber under 2.05 mm; sandwich rubber under 4.05 mm. (Older handbooks read "not more than 2.0 / 4.0 mm".) 2.4.6 Matt, black on one side and a bright colour clearly distinguishable from black and from the ball on the other. This is the post-2021 wording; before 1 October 2021 the Law said "bright red". The rackets here are black on one face and red or blue on the other, which is legal under either wording. 2.5.8 Obstruction: touching the ball before it has touched your own court, while it is above or travelling towards the playing surface. 2.6.1-4 The service: from the open palm of a stationary free hand, projected near vertically upwards without spin, rising at least 16 cm, struck as it is falling, from behind the end line and above the level of the playing surface, touching the server's court and then the receiver's. 2.7.1 A return is good if it touches the opponent's court, directly OR after touching the net assembly. A net cord in a rally is play on. 2.9.1.1 But a SERVICE that touches the net assembly and is otherwise correct is a let, and is replayed. 2.10.1 The point, in fifteen sub-clauses. The ones two physics agents can produce are implemented; the rest are listed under NOT IMPLEMENTED. 2.10.1.5 Through the net, between net and post, or between net and surface. By 2.2.4 there is no such gap, and the app proves it: a fine sweep of the whole net rectangle finds no hole, five thousand Monte Carlo rallies never produce one, and a synthetic ball forced through it does trigger the clause - so "never" is a measurement, not an assumption. 2.11.1 A game is won by the first to 11, unless both reach 10, when it is won by the first to lead by 2. 2.12.1 A match is the best of any ODD number of games. The app refuses an even number. 2.13.3 The receiver becomes the server after every 2 points - and after every 1 from 10-10, or once the expedite system is running. 2.13.6 The player serving first in a game receives first in the next. 2.13.7 Ends change after every game, and in the last possible game of a match when one player first reaches 5 points. 2.15.1 The expedite system comes in after 10 minutes' play in a game... 2.15.2 ...unless at least 18 points have been scored. Note that this is a TOTAL, not "nine each": at 10-7, seventeen points, expedite still comes in, where the older "both have scored at least 9" wording would have blocked it. 2.15.3 Play resumes with service by the player who received in the preceding rally. 2.15.4 Each player then serves for one point in turn, and if the receiver makes 13 correct returns the receiver scores the point. 2.15.6 Once introduced it lasts the rest of the match. ================================================================================ THE PHYSICS: FROM PUBLISHED MEASUREMENT ================================================================================ The flight and the bounce are not tuned by feel. Every coefficient comes from a measurement of a real 40 mm ball, and the app is checked against measurements it was NOT built from. DRAG AND LIFT Tanaka K., Fukujyu T., Miyazaki T. and Himeno R., "Aerodynamic characteristics of a table tennis ball", Nagare (Journal of the Japan Society of Fluid Mechanics) 33, 37-45 (2014). The open-access full dataset is Tanaka's master's thesis, University of Electro-Communications, 2014: https://uec.repo.nii.ac.jp/record/4896/files/1232052.pdf A Nittaku Premium 3-star ball was launched by a three-rotor machine and tracked with high-speed video over 2e4 <= Re <= 9e4 and 0 <= SP <= 1 - the whole envelope of a rally. Non-spinning drag coefficient: 0.453 at Re 1.8e4 and 0.456 at Re 4.0e4, to within about 2%. The app's coefficient surface is built from the shape and the extrema that the thesis reports per Reynolds number (section 6.2) plus those zero-spin anchors (section 5.2). It is then checked against the thesis's SEPARATE flight-versus-wind-tunnel table (Table 6.1, eleven measured points), which was deliberately not used to build it. On that held-out data the model reproduces the drag coefficient to 3.3% on average and 9.8% at worst, and the lift coefficient to 15.9% on average and 49.6% at worst - the worst case being at the bottom of the lift valley, where the measured curve is steepest. THE LIFT CRISIS Miyazaki T., Sakai W., Komatsu T., Takahashi N. and Himeno R., "Lift crisis of a spinning table tennis ball", European Journal of Physics 38(2), 024001 (2017). https://iopscience.iop.org/article/10.1088/1361-6404/aa51ea The lift coefficient is NOT a rising function of spin. It climbs to about 0.30, collapses into a valley near a spin parameter of 0.5 to 0.7, and rises again. The obvious model a game would reach for - lift proportional to spin - is wrong by more than a factor of two at SP 0.6 and has no valley at all. The app implements the measured curve, so a ball with MORE topspin can drop LESS than one with a little less. That is the measurement, not a feature anyone added; Tanaka's Fig 6.27 reports exactly the same inversion. Corroborated independently by Philip C. et al., "Magnus regimes of a spinning Table Tennis ball", Physics of Fluids 37(8), 087109 (2025), whose wake survey finds the same increase-decrease-increase structure. Inverse (negative) Magnus is deliberately NOT implemented: free-flight measurements over the whole table tennis envelope did not find it. A Reynolds-number drag crisis is deliberately NOT implemented either: a smooth sphere's is near Re 3.5e5 and a rally tops out near 1.1e5. THE FORM OF THE EQUATIONS, AND THE AIR Inaba Y., Tamaki S., Ikebukuro H., Yamada K., Ozaki H. and Yoshida K., "Effect of changing table tennis ball material from celluloid to plastic on the post-collision ball trajectory", Journal of Human Kinetics 55, 29-38 (2017). https://pmc.ncbi.nlm.nih.gov/articles/PMC5304273/ Air at 20 C: density 1.204 kg/m3 and kinematic viscosity 1.506e-5 m2/s, the values used by Ito K. and Kamijima K., Transaction of the Japan Society for Simulation Technology 17(1), 25-31 (2025), whose CFD tables were used as a cross-check on the shape of the curves at spin parameters Tanaka did not reach. https://www.jstage.jst.go.jp/article/tjsst/17/1/17_25/_pdf THE BOUNCE Inaba et al. (above) launched plastic balls at a real table at 15 to 115 km/h and filmed the bounce at 1000 Hz. Converted to SI, their fits are e = 1.002 - 0.0209 |v_normal| mu = 0.2526 + 0.00396 |v_contact| and the app uses the SLOPE of the first and the whole of the second. THE TWO SOURCES DISAGREE, and this app decides rather than fudges. At the impact speed of the Law's own drop test, 2.426 m/s, the Inaba regression extrapolates to e = 0.951 - a 27.1 cm rebound where Law 2.1.3 requires about 23 cm. The Law wins on the absolute value: it is the normative specification every conforming table must meet, Inaba's slowest launch was 15 km/h so the drop-test speed is below their fitted range, and their intercept of 1.002 is unphysical (a restitution above 1 at zero speed). Inaba wins on the slope, being the only direct measurement of it. So the app anchors the Law's value at the Law's own test speed and carries it with Inaba's measured slope. That COMBINATION is this app's choice and is listed under RECONSTRUCTED. The ball is modelled as a THIN SPHERICAL SHELL, I = (2/3) m r^2, not a solid sphere. This is not a preference. Inaba's published worked service - 21.0 km/h horizontal, 8.0 km/h down, 60 rev/s of backspin - comes off their table at 16.3 km/h, 7.7 km/h up and 44 rev/s. The shell model reproduces 16.22, 7.64 and 44.1. A solid sphere would predict the spin change 5/3 larger and get the answer wrong. A finding worth stating plainly, because the received wisdom says otherwise: under this measured friction law a backspin ball does NOT come off the table backwards, and cannot. The available friction impulse is mu(1+e)|v_normal|, and mu only reaches about 0.4 at realistic contact speeds, so the horizontal speed can be roughly halved but never reversed. Inaba's own published serve agrees: 60 rev/s of backspin becomes 44 rev/s of backspin, reduced and not reversed. Forcing mu up to 1.3 does reverse it, which is how we know the result is a property of the measurement and not of the code. CROSS-CHECKS AGAINST DATA THE MODEL WAS NOT BUILT FROM Kidokoro S., Inaba Y., Yoshida K., Yamada K. and Ozaki H., "A topspin rate exceeding 110 rps reduces the ball time of arrival to the opponent", Sports Biomechanics 24(3), 778-794 (2025). https://www.tandfonline.com/doi/full/10.1080/14763141.2022.2156916 They measured topspin drives at 23 m/s at the baseline and again 0.15 s later, and found balls at 110 rev/s or more arriving 1.4 m/s faster than balls at 80 rev/s or less - more spin, LESS drag, because of the drag valley. The app's integrator, run on the same conditions, gives 1.00 m/s. Same sign, same mechanism, within 30% of the measured size. With a flat drag coefficient the effect disappears entirely. Yoshida K. et al., "The rotation speed of the service ball delivered by world-class table tennis players", Japan Journal of Physical Education, Health and Sport Sciences 59(1), 227-236 (2014). 329 services at the 2009 World Championships, filmed at 1000 fps: 13.7 to 62.5 rev/s overall, men 46.0 +/- 9.0. The app's solved services come out between 9 and 44 rev/s, inside that envelope rather than outside it. ================================================================================ RECONSTRUCTED: EVERYTHING THIS APP CHOSE, BECAUSE NOBODY PUBLISHES IT ================================================================================ The Laws fix the table, the net, the ball and the game. They fix nothing about how a racket is shaped, how rubber grips, what a net cord does, or how well anybody plays. All of the following is this app's own, and is marked RECONSTRUCTED in js/tabletennis.js where it lives. THE RACKET. Law 2.4.1 says "any size, shape or weight". This one has a 151 mm round blade, 8.5 mm thick including both rubbers, a 100 mm grip and a mass of 180 g. All four numbers are invented; only the 85% wood, the rubber thickness ceilings and the two-colour rule are real constraints. HOW THE RUBBER GRIPS. Normal restitution 0.86, tangential restitution 0.45, friction 1.20. Gossard T., arXiv:2604.11349 (2026), measured 8194 bounce events across ten racket configurations and reports a restitution falling about 0.021 per m/s of impact for inverted rubbers - close to Inaba's 0.0209 for the ball on the table - but no per-rubber table exists, so these three numbers are chosen, not measured. The friction is deliberately high enough that contact is rolling for every stroke the game can produce, which is what makes a brushing stroke produce spin instead of speed. THE NET CORD. A ball that clips the net keeps 16% of its through-the-net speed and 55% of its along-the-net speed and loses 45% of its spin. Nothing about this is published; the Laws only say the net is close to the surface and attached to the posts. THE STROKES. Five of them - drive, loop, push, block, smash - each a face angle, a swing elevation and a swing speed. Which balls each one can actually return is emergent and was measured rather than designed: the loop returns almost anything, the drive fails against heavy backspin, the push fails against heavy topspin, the block only works against topspin, and the smash only works against a high ball. That reads like table tennis because the physics is the same, not because anyone wrote those rules down. THE OPPONENT. Three levels, each a set of standard deviations on the five numbers of a stroke plus how many candidate strokes it considers and how much of the table it can cover. Nothing is claimed about its standard of play; what it actually does is measured in the harness and reported below. THE SPIN DECAY IN FLIGHT (0.35 per second), the table's own thickness (45 mm), the net post section (22 mm), the leg positions, and every colour on the screen. The Laws require only that the surface be uniformly dark and matt. THE COMBINATION of the Law's restitution value with Inaba's measured slope, as described above. Each half is sourced; putting them together is not. THE CAMERA. Ends really do change under 2.13.7 and the app says so, but the camera follows you round rather than showing you the far end. The physics is exactly symmetric between the ends and the harness proves it, so this is a presentation choice with no effect on play. A SERVICE IS STRUCK FOR YOU, at the instant it was solved for. You choose its spin, its length and its line. Letting the player also choose the instant would mean striking a ball the solution never saw - the racket arrives 45 ms after the key, by which time the ball is 10 cm lower - and every such service would be a fault. ================================================================================ LAWS THAT ARE NOT IMPLEMENTED ================================================================================ Listed rather than quietly dropped. Two physics agents and a ball cannot produce them: 2.10.1.7 a deliberate double hit 2.10.1.8 striking with a non-compliant side of the blade 2.10.1.9 moving the playing surface 2.10.1.10 touching the net assembly with the body 2.10.1.11 the free hand on the playing surface 2.10.1.12 doubles, striking out of sequence 2.10.1.14, 2.10.1.15, 2.8.3, 2.9.1.5 wheelchair play 2.6.4 (the hidden-serve half), 2.6.5, 2.6.6.1 there is no umpire here, so the service is legal by construction and a doubtful-service warning has nothing to warn about 2.9.1.2, 2.9.1.3, 2.9.1.4 a receiver who is not ready, an outside disturbance, an umpire's interruption 2.14 serving, receiving or changing ends out of turn: the engine cannot do it, so there is nothing to correct Doubles is not implemented at all. The centre line is drawn because 2.1.6 says it is there. ================================================================================ HISTORY ================================================================================ The sport began in Victorian England as an after-dinner parlour game, played with books stood along the middle of the table for a net and more books for bats. (The often-repeated "cigar box lid and a champagne cork" version is not what the authoritative sources say; they say books and a golf ball, or battledores and a cork ball.) 1901 James Gibb brought back celluloid novelty balls from the United States, and E. C. Goode fixed a sheet of pimpled rubber to a wooden blade. 1926 The ITTF was founded, in Berlin in January and London in December, by nine members. The first World Championships followed in London that December. 1988 Table tennis entered the Summer Olympic Games. 2000 The ball grew from 38 mm to 40 mm, to slow the game down. 2001 Games went from 21 points to 11, and the service from five in a row to two, effective 1 September. 2002 Hiding the ball during service was banned and the 16 cm minimum toss introduced; the free-arm rule followed at the 2003 Paris AGM. 2014 Celluloid gave way to plastic. 2021 From 1 October, the non-black side of a racket may be any bright colour clearly distinguishable from black and from the ball, not only red. Source for the history: Wikipedia, "Table tennis" and "International Table Tennis Federation", https://en.wikipedia.org/wiki/Table_tennis - a tertiary source, and treated as one. Where its account of the "Ping-Pong" trademark's registrant and date is disputed by other records, this app does not take a side, and it does not claim that the ITTF chose the name "table tennis" because of the trademark: no source about the 1926 founding says so. ================================================================================ WHAT WAS TESTED, AND WHAT IT FOUND ================================================================================ tools-normals.js 66 assertions over 2056 triangles. Written BEFORE the renderer existed, and it caught five separately inverted primitives - the ball, the cylinder wall, the playing surface, the painted lines and the room - plus a handle interpenetrating its own blade. None of that is visible in a screenshot: with back-face culling on, an inside-out solid is simply absent. tools-oracle.js a second implementation sharing no code: adaptive Dormand-Prince 5(4) instead of fixed-step RK4, the bounce derived from angular momentum about the contact point instead of from an impulse expression, the Laws as a closed-form service rule instead of a running counter, and closed forms for one-dimensional drag. tools-harness.js 370 assertions. It found: a toss thrown at the vacuum speed for 16 cm actually rises 15.7 cm and is an ILLEGAL SERVICE under 2.6.2; a rally could dribble on for ever because a settling ball bounced infinitely often in finite time; a ball that descended past the end line could travel under the table and fall for ever with no floor beneath it; and the accounting for a served ball's two legal bounces credited the wrong player when the receiver let it go. tools-harness-page.js the bundle, the CSP, the wiring, and every number the Help panel quotes checked against the constant it claims to quote. tools-smoke.js headless Chrome, locally and against the live host. Measured, not claimed: the opponent's win rates and rally lengths are printed by the harness and reproduced in the release notes. ================================================================================ LICENCE ================================================================================ This implementation is MIT-licensed; see LICENSE.txt. The Laws of Table Tennis and the ITTF technical leaflets remain the ITTF's. The papers cited above remain their authors' and publishers'.