Badminton ========= An independent, from-scratch browser implementation of singles badminton, played under the Laws of the sport's governing body. It is not a reimplementation of any particular video game and it is not affiliated with, endorsed by, or connected to any badminton organisation. THE RULES --------- Badminton World Federation (BWF), founded 1934 as the International Badminton Federation. BWF Statutes, Section 4.1: LAWS OF BADMINTON. In force 23/05/2021, version 1.0. https://extranet.bwf.sport/docs/document-system/81/1466/1470/Section%204.1%20-%20Laws%20of%20Badminton.pdf Everything the game calls a rule is quoted from that document, in its own numbering style ("Law 1.10", "Law 10.1.1"). Diagram A supplies the court's dimension chain and Diagram B the optional shuttle testing marks; both were read from the published PDF at 600 dpi. THE AERODYNAMICS THE LAWS DO NOT FIX ------------------------------------ The Laws fix no drag coefficient, no terminal velocity, no air density and no gravity datum. Law 3 (Testing a shuttle for speed) is one equation in two unknowns: it fixes where a correct shuttle lands but says nothing about the stroke that sends it there. The remaining constants come from: C. Cohen, B. Darbois Texier, D. Quere and C. Clanet, "The physics of badminton", New Journal of Physics 17 (2015) 063001. https://iopscience.iop.org/article/10.1088/1367-2630/17/6/063001 - drag coefficient 0.65 +/- 0.05 at a reference area of 28 cm^2, i.e. a drag area of 1.820e-3 m^2, which is the single quantity this game's flight model needs; - centre-of-gravity to centre-of-pressure distance 2.0 cm and pitch moment of inertia 1.2e-6 kg m^2, which set the restoring torque; - measured flip time 15 ms and stabilising time 130 ms at 18.6 m/s, which set the racket impulse and the pitch damping. Closing Law 3 with that drag area SOLVES the test stroke: 61.22 m/s at 23.84 degrees from a 1.00 m contact, landing exactly 760 mm short of the far back boundary line - the centre of the Law 3.2 band. Inverting it, the 530-990 mm band pins the terminal velocity to 6.63-6.79 m/s, an interval that contains the independently measured 6.7 m/s. The small-oscillation period of the shuttle's pitching, which was not fitted to anything, comes out at 79 ms against their measured 80 ms. RECONSTRUCTED (the Laws are silent; these are this implementation's choices) --------------------------------------------------------------------------- * air density 1.225 kg/m^3 (ICAO standard atmosphere, sea level, 15 C) and standard gravity 9.80665 m/s^2. Law 2.4 explicitly leaves altitude and climate to a Member Association. * shuttle mass 5.12 g and skirt diameter 63 mm: the midpoints of Law 2.2.6 and Law 2.2.3. * the Law 3.1 stroke's contact height (1.00 m) and elevation (the range-maximising angle). Law 3.1 says only "a full underhand stroke ... at an upward angle". * whether "530 mm short of the other back boundary line" is measured to that line's near edge, far edge or centre. The Laws do not say and Diagram B is schematic, not to scale (its own drawn spacings are 203:155:109 px where the geometry needs 530:150:190). The ambiguity is one line width, 40 mm, or 8.7 % of the band; the shipped shuttle is inside the band under both readings. * the extra drag while flying skirt-first (taken as double the cork-first value at 180 degrees, tapering as the square of the reversedness). * the shape of the net between the two heights Law 1.10 fixes (parabolic). * everything about the players. The Laws fix no racket mass, string tension, player speed or reaction time. WHAT DIFFERS FROM THE SPORT --------------------------- * Singles only. The doubles service courts and the doubles long service line are drawn and the engine implements the Law 11 rules, but a doubles match is not playable. * One shuttle speed. Real shuttles are graded, and Law 2.4 allows local variation. * No lets (Law 14), no service judge, no line judges, no Instant Review System, no service-court-error correction (Law 12), no intervals (Law 16.2) and no misconduct (Law 16.6). The service height rule (Law 9.1.6) is satisfied by construction rather than judged. * A shuttle that clips the net cord and drops back is treated as a fault by the striker rather than resolved through Law 15.1's "starts to fall" test. * Player movement is a simple accelerated chase, and a stroke is played automatically when the shuttle comes within reach. BUILD ----- No libraries, no CDN, no fonts, no network. Hand-written WebGL2. The engine (js/badminton.js) is pure, deterministic and DOM-free; every match replays bit-identically from its seed, and identically at 30, 60, 90, 144 and 240 frames a second because the engine reads an absolute clock rather than accumulating deltas. Licence: see LICENSE.txt.