geomlib

Interactive Euclidean geometry constructions, in the browser.

Home  |  Table of Contents  |  Using geomlib diagrams

What is geomlib?

geomlib is a TypeScript library that renders interactive Euclidean geometry diagrams on an HTML5 <canvas>. Drag a free point and every dependent construction follows; the geometry is recomputed from first principles every frame. All 465 propositions across Books I–XIII of Euclid's Elements are renderable — you can see them throughout this site.

Use via CDN

Drop the bundle into any HTML page, then call geomlib.init({...}):

<canvas id="propI1" style="width:340px; height:240px;"></canvas>
<script src="https://unpkg.com/@brownnrl/geomlib@0.1.0/dist/bundle.js"></script>
<script>
  const E = geomlib.E;
  geomlib.init({
    canvasid: "propI1",
    elements: [
      { name: "A", construction: E.Point.free,    params: [125, 130] },
      { name: "B", construction: E.Point.free,    params: [215, 130] },
      { name: "AB", construction: E.Line.connect, params: ["A", "B"] },
      // ...
    ],
  });
</script>

Or install from npm

npm install @brownnrl/geomlib

Links: npm package · source on GitHub · README · NOTICE / attribution

Original work — Clark University attribution

geomlib is a TypeScript port of Geometry Applet v2.2, the 1996 Java applet written by Dr. David E. Joyce (Professor Emeritus, Department of Mathematics and Computer Science, Clark University). The applet illustrated his online edition of Euclid's Elements from 1996 until Java applets ceased to function in modern browsers.

This port was undertaken with Dr. Joyce's explicit permission, granted in 2026. For the full permission text, the joint-copyright statement, and the list of preserved Java reference materials, see the NOTICE in the geomlib repository.

The MIT-licensed TypeScript code is joint-copyright: © 1996–2020 David E. Joyce, 2019–2026 Nelson Brown. The Elements narrative content republished on this site is © David E. Joyce, used by permission — see site copyright.

Other works powered by geomlib

Beyond the Elements, this site mirrors several other Joyce-authored geometry tutorials, now driven by geomlib instead of the original Java applet:

Library test artifacts

For transparency, the latest test-run artifacts from the geomlib repository are mirrored here:

← Home