Equilibrium tide theory: the Moon and Sun stretch the ocean into two bulges. Spin the Earth under them, line the bodies up, and read the tide at a gauge you can place anywhere.
Orange: Moon and Sun together. Blue: Moon alone. Yellow: Sun alone. White line: now. Watch the heights grow near new and full Moon (spring) and shrink near the quarters (neap).
running...
The science
Tidal potential. A body of mass M at distance d pulls the near side of the Earth harder than the far side. After removing the uniform part (which is the orbital free fall), what is left is a stretching potential U = -(G M R²/d³)·(3cos²ψ - 1)/2, where ψ is the angle between the place and the body.
Equilibrium tide. If the ocean could settle instantly, its surface would be an equipotential, so the height is ζ = -U/g = (M/M⊕)(R⊕/d)³ R⊕ · (3cos²ψ - 1)/2. For the Moon this gives a peak of about 0.36 m under the Moon and on the opposite side (two bulges), and -0.18 m on the ring 90 degrees away. For the Sun the same formula gives about 0.16 m, i.e. 0.46 of the lunar value.
Why twice a day. The bulges point at the Moon and away from it; a place rotates through both each lunar day of 24 h 50 min (the Moon moves 360/27.32 degrees per day along its orbit), so high water repeats every 12 h 25 min.
Spring and neap. At new and full Moon the two bulges add (AM + AS); at the quarters they partly cancel (AM - AS). The ratio of spring to neap range is therefore about 2.7. The beat period is half the synodic month, 14.77 days.
Distance and tilt. The tide scales as 1/d³: the Moon at perigee (about 357 000 km) raises tides about 40 % higher than at apogee (about 406 000 km). Axial tilt and the Moon's declination make successive high waters unequal at mid latitudes (the diurnal inequality).
Honest simplifications. Real ocean tides are not equilibrium tides. The ocean has inertia, friction, continents and basin resonances; amplitudes in real harbours range from a few centimetres to over ten metres and arrive hours late. This model uses perfectly circular lunar orbits in the ecliptic plane (no 5 degree inclination, no precession), no ocean dynamics and no land, so it predicts the pattern and the ratios, not the height in a particular harbour. Masses, distances and periods are standard textbook values (rounded). The bulge on screen is exaggerated.
Models: Blender 5.2 (stylised Earth and cratered Moon, baked textures). Rendering: Three.js r160.