Euclid
Euclidean geometry in javascript. Here's a demo; here's another one.
NOTE: Still very preliminary / experimental.
git clone https://github.com/anandthakker/euclid.gitcd euclidnpm installgulp
Usage
Load It:
Add dist/geometry.css
for the basic SVG styles.
Put an <svg>
element somewhere.
Pull in the javascript, either as a node module...
var geom = ;
or a browser standalone(ish) script (depends on d3
to be
loaded already).
<!-- exposes geom as a global -->
Use It:
And then
var scene =left: 0top: 0right: 1000bottom: 1000;scene// add a couple of free points.// add circle centered at point 'A', with point 'B' on its circumference.// tag subsequent objects with string 'layer2', used by renderer to add// arbitrary CSS classes to svg objects.// let C and D be the two intersections of circles M and N// let E be the intersection of line T and circle M that *isn't* equivalent to point C.// render using d3.var render = geom;;