A TypeScript library for 2D Euclidean geometry with classes for shapes, intersection detection, and SVG/Canvas drawing.
Euclid.ts is a TypeScript library for 2D Euclidean geometry that provides immutable classes for geometric shapes, intersection detection, and drawing utilities for SVG and Canvas. It solves the problem of handling geometric computations and visualizations in interactive applications, particularly in educational contexts like Mathigon.org.
Developers building interactive geometry applications, educational software, data visualizations, or any project requiring 2D geometric computations and rendering.
Developers choose Euclid.ts for its comprehensive geometry primitives, immutable design that facilitates change detection, and built-in support for both SVG and Canvas drawing, making it versatile for various rendering needs.
2D Euclidean geometry classes, utilities, and drawing tools
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
All class instances are immutable, enabling fast change detection for downstream libraries, which is explicitly mentioned in the README as beneficial for interactive applications.
Supports a wide range of geometric primitives including points, lines, circles, polygons, ellipses, arcs, and sectors, as listed in the API section.
Provides utilities to draw geometric elements to both SVG and HTML Canvas with configurable options, making it versatile for different web rendering needs.
Built as a TypeScript library, offering type safety and better development experience for modern JavaScript projects.
Exclusively handles 2D Euclidean geometry, with no support for 3D computations or other geometric systems, limiting its use in spatially complex applications.
Immutability facilitates change detection but can lead to increased memory usage and performance overhead in scenarios with high-frequency object creations, such as real-time simulations.
Developed primarily for Mathigon.org, it has fewer community extensions, plugins, or integrations compared to more established geometry libraries.