This game draws its field, ball and strike zone with WebGL2 and no libraries. Your browser did not provide a WebGL2 context.
An independent reimplementation of the pitcher–batter contest, written from scratch. The rules come from the Official Baseball Rules, 2026 Edition, published by the Office of the Commissioner of Baseball. This is not affiliated with, endorsed by, or licensed from Major League Baseball or any club.
“The STRIKE ZONE is that area over home plate the upper limit of which is a horizontal line at the midpoint between the top of the shoulders and the top of the uniform pants, and the lower level is a line at the hollow beneath the kneecap. The Strike Zone shall be determined from the batter's stance as the batter is prepared to swing at a pitched ball.” — Definitions of Terms, “STRIKE ZONE”
So the zone is a prism standing on home plate, and it has depth: a curveball that clips the top at the front edge and has dropped below it by the back edge is still a strike, because “any part of the ball” passed through “any part of the strike zone” (Definitions of Terms, “STRIKE” (b)). The ball has a finite radius, so the region its centre may occupy is the prism grown by 1.4523 in in every direction — with rounded edges and spherical corners, not an inflated box.
The top and the bottom belong to the batter. Statcast's measured per-batter values over 327 batters run from 2.80 ft to 4.12 ft at the top and 1.22 ft to 1.89 ft at the bottom, a 47% spread in zone height; the league means are 3.44 ft and 1.60 ft. The Batter size slider moves within that measured range.
Only the part of the spin perpendicular to the velocity makes a force. The part along
the velocity — gyro spin — makes none, because the Magnus acceleration goes as
ω̂ × v̂ and that cross product vanishes when they are parallel. The measured
fraction is published as spin efficiency (Statcast calls it active spin).
That is why the pitch types here differ by their axis and not by their names. Two pitches from the 2025 season make the point: the slider averages 2433 rpm at 32% active spin and moves 6.2 in; the sweeper averages 2605 rpm at 51% active spin and moves 15.1 in. That is 7% more spin and 142% more movement. A model that read the spin rate alone could not produce both, and the four-seam settles it: it spins slower than a slider (2317 rpm) and moves more than three times as far.
Drag is CD = 0.28 + 0.0292·ωT/1000 and lift is
CL = 1.120·S/(0.583 + 2.333·S), with the transverse spin
ωT = |ω × v̂|. The whole coupled state — position, velocity and spin —
is advanced together by RK4 at a fixed step.
The bat is one piece of solid wood at most 2.61 in across and 42 in long (Rule 3.02(a)); the modelled bat is 34 in, 30.9 oz, balance point 23.0 in from the knob and 11516 oz·in² of swing weight — a real measured wood bat. The exit speed is solved from momentum and restitution against the bat's effective mass at the impact point, so hitting off the end really does cost you.
BBCOR does not apply here. It governs bats “constructed with materials other than one-piece solid wood”, and Rule 3.02(a) requires wood; the Official Baseball Rules set no bat performance limit at all. So the ball–bat restitution is reconstructed: it is set to 0.500, the BBCOR ceiling, which is calibrated so that a non-wood bat performs no better than wood. Run the standard's own test through this model — a ball fired at a bat at rest, striking 6 in from the barrel end — and it returns exactly 0.500.
Four balls is a base on balls (5.05(b)(1)). A third strike caught by the catcher is a strikeout (5.09(a)(2)); uncaught, the batter is out if first base is occupied with fewer than two out (5.09(a)(3)) and otherwise becomes a runner (5.05(a)(2)). A foul with two strikes is nothing — “when he has less than two strikes” — but a bunt foul on strike three is an out (5.09(a)(4)), and a caught foul tip is a strike like any other, so on strike three it ends the at-bat.
The field: 60 ft 6 in from the pitcher's plate to the rear point of home, a plate 10 in above the ground, bases 18 in square, at least 325 ft down the lines and 400 ft to centre.
The rules leave some things to the umpire and say nothing about others. Reconstructed here,
and labelled as such: the ball–bat restitution and friction; the swing kinematics; the
fielders' positions and closing speed; how many bases an uncaught fair ball is worth; the
ground's bounce and roll; the batter's body for a hit batsman; what counts as “sharp and
direct” for a foul tip; and the mapping from the Batter size slider into the measured
zone range. Everything else carries a rule number. See CREDITS.txt.