geometry_kit library

A Dart package providing immutable 2D geometry primitives and utilities.

Includes Point, Line, Circle, Triangle, Polygon, Rectangle, Ellipse, Ray, Arc, Quadrilateral, Ring, Capsule, Polyline, QuadraticBezier, CubicBezier, Spline, and angle conversion tools.

All geometry classes are immutable — transform methods return new instances.

Classes

AngleUtils
Angle Utils
Arc
An arc defined by a center, radius, start angle, and end angle.
Capsule
A capsule (stadium) shape — a rectangle with semicircle caps on each end.
Circle
A circle defined by a center point and a radius.
CubicBezier
A cubic Bezier curve defined by four control points.
Ellipse
An ellipse defined by its center and two radii.
Line
A line segment defined by two endpoints a and b.
Point
An immutable 2D point (or vector) with x and y coordinates.
Polygon
A polygon defined by an ordered list of vertices.
Polyline
An open path defined by a sequence of connected points.
QuadraticBezier
A quadratic Bezier curve defined by three control points.
Quadrilateral
A quadrilateral defined by four vertices in order.
Ray
A ray defined by an origin point and a direction.
Rectangle
An axis-aligned rectangle defined by position and size.
Ring
A ring (annulus) defined by two concentric circles.
Shape
Base interface for all 2D geometric shapes.
Spline
A Catmull-Rom spline through a series of control points.
Triangle
A triangle defined by three vertices a, b, and c.

Extensions

DegX on Deg
Extension on Deg for converting degrees to radians.
RadX on Rad
Extension on Rad for converting radians to degrees.

Typedefs

Deg = double
A value in degrees.
Rad = double
A value in radians.
Segment = Line
A segment is a finite portion of a line between two endpoints.