# Delaunay class Null safety

A class for quickly calculating the Delaunay triangulation in 2D of a set of points in the cartesian plane.

Example usage:

``````Float32List points = Float32List.fromList(<double>[
143.0, 178.5,
50.2, -100.7,
...
]);
Delaunay delaunay = Delaunay(points);
delaunay.update();
for (int i = 0; i < delaunay.triangles.length; i += 3) {
int a = delaunay.triangles[i];
int b = delaunay.triangles[i + 1];
int c = delaunay.triangles[i + 3];

double ax = delaunay.coords[2*a];
double ay = delaunay.coords[2*a + 1];
...
}
...
points = 140.0;
delaunay.update();
...
``````

This implementation is adapted from the Delaunator JavaScript library. See https://github.com/mapbox/delaunator

## Constructors

Delaunay(Float32List coords)
Allocates memory for a Delaunay triangulation, keeping a reference to `coords`.
Delaunay.from(List<> points)
Allocates memory for a Delaunay triangulation.
factory

## Properties

colinear bool
Whether after a call to initialize, it has been detected that this is the degenerate case of all points being colinear.
coords
The coordinates being triangulated.
halfEdges
The list of edges in the triangulation.
hashCode int
The hash code for this object.
hull
The indices in coords of the points on the convex hull of the input data, counter-clockwise.
runtimeType Type
A representation of the runtime type of the object.
triangles
The list of triangles in the triagulation.

## Methods

getPoint(int i) Point<double>
`coords[i]` in the form of a `Point<double>`.
initialize() → void
Initializes the Delaunay triangulation by finding the seed triangle and sorting the points in increasing distance from the seed triangle's circumcenter.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
processAllPoints() → void
Iterates over all the points in order of increasing distance from the seed triangle's circumcenter, adding them to the triangulation.
swap(Uint32List arr, int i, int j) → void
toString()
A string representation of this object.
inherited
update() → void
Calculates or recalculates the Delaunay triangulation.

## Operators

operator ==(Object other) bool
The equality operator.
inherited