Home▸Molecular Biology▸DNA Double Helix: Rotating Base-Pair Ladder (2D)

DNA Double Helix: Rotating Base-Pair Ladder (2D)

A 2D companion to the 3D DNA helix: the same parametric geometry — twist, backbone radius and rotation speed — projected onto a flat canvas, with depth used to brighten, widen and layer the near strand over the far one so the ladder still visibly rotates in three dimensions.

Molecular Biology2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-dna-helix-molecular-biology ↗ Open standalone

The 3D version of this simulation builds a real WebGL double helix by walking a parametric curve — two strands offset 180° around a shared axis, connected by base-pair rungs, twisting as they rise. This 2D companion runs the exact same equations — angle θi = i·0.28·twist + rotation phase, positions x=cos(θ)·R, z=sin(θ)·R on each strand — but projects them onto a flat canvas itself instead of handing them to a 3D renderer: the depth coordinate that a camera would normally consume is used directly to brighten, widen and paint the near strand over the far one, in back-to-front order every frame, so the helix still visibly rotates in depth on nothing but Canvas2D. Twist, backbone radius, rotation speed and base-pair count are all live, and a readout panel tracks the current rotation angle, the derived helical pitch (bp per full turn) and the rung count in real time.

⚙ Under the hood

A 2D depth-shaded projection of the same parametric double-helix curve the 3D engine renders in WebGL: painter's-algorithm layering by depth, live twist/radius/speed/base-pair controls, and a derived helical-pitch readout.

DNAdouble helixbase pairingmolecular biology2D projection

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)