README

elm-geometry

elm-geometry is an Elm package for working with 2D and
3D geometry. It provides a wide variety of geometric data types such as points,
vectors, arcs, spline curves and coordinate frames, along with functions for
transforming and combining them in many different ways. You can:

Rotate points around axes in 3D

Mirror triangles across 3D planes

Project 3D geometry into 2D sketch planes

Measure distances and angles between different objects

Convert objects between different coordinate systems

Compose complex 2D/3D transformations

...and much more!

A wide variety of data types are supported:

Point2d, Point3d, Vector2d, Vector3d, Direction2d, Direction3d

Axis2d, Axis3d, Plane3d

Frame2d, Frame3d, SketchPlane3d

BoundingBox2d, BoundingBox3d

LineSegment2d, LineSegment3d, Triangle2d, Triangle3d

Polyline2d, Polyline3d, Polygon2d

Circle2d, Circle3d, Arc2d, Arc3d

Ellipse2d, EllipticalArc2d

QuadraticSpline2d, QuadraticSpline3d, CubicSpline2d, CubicSpline3d

A large range of geometric functionality is included, such as various forms of
constructors...

Vector3d.sum v1 v2
-- the vector from the point p1 to the point p2
Vector2d.from p1 p2
Vector3d.crossProduct v1 v2
Vector2d.length vector
-- distance of a point from the origin point (0, 0)
point |> Point2d.distanceFrom Point2d.origin

Documentation

Full API documentation
is available for each module. Most modules are associated with a particular data
type (for example, the Point3d
module contains functions for creating and manipulating Point3d values).

Usage details

Following the Elm package design guidelines,
most elm-geometry modules are designed to be imported exposing only the
corresponding types, and using the module name as a prefix for everything else:

Questions? Comments?

Please open a new issue if you
run into a bug, if any documentation is missing/incorrect/confusing, or if
there's a new feature that you would find useful. For general questions about
using elm-geometry, try:

Joining the #geometry channel on the Elm Slack,
or sending me (@ianmackenzie) a message - even if you don't have any
particular questions right now, it would be great to know what you're hoping
to do with the package!