Package-level declarations

Types

Link copied to clipboard
class Delaunator(val coords: DoubleArray)

A Kotlin port of Mapbox's Delaunator incredibly fast JavaScript library for Delaunay triangulation of 2D points.

Link copied to clipboard
class Delaunay(val points: DoubleArray)

Use from static method to use the delaunay triangulation

Link copied to clipboard
class DelaunayTriangulation(val points: List<Vector2>)

Kotlin/OPENRNDR idiomatic interface to Delaunay

Link copied to clipboard
class Voronoi(val delaunay: Delaunay, val bounds: Rectangle)

This is a fast library for computing the Voronoi diagram of a set of two-dimensional points. The Voronoi diagram is constructed by connecting the circumcenters of adjacent triangles in the Delaunay triangulation.

Link copied to clipboard
class VoronoiDiagram(val delaunayTriangulation: DelaunayTriangulation, val bounds: Rectangle)

Properties

Link copied to clipboard
Link copied to clipboard
const val f: Int = 134217729

=== 2^Math.ceil(p/2) + 1 where p is the # of significand bits in a double === 53.

Functions

Link copied to clipboard
fun circumcenter(ax: Double, ay: Double, bx: Double, by: Double, cx: Double, cy: Double): DoubleArray
Link copied to clipboard
fun circumradius(ax: Double, ay: Double, bx: Double, by: Double, cx: Double, cy: Double): Double
Link copied to clipboard

Returns the result of adding two double-double-precision floating point numbers.

Link copied to clipboard

Returns the result of subtracting the second given double-double-precision floating point number from the first.

Link copied to clipboard

Returns the product of two double-double-precision floating point numbers.

Link copied to clipboard

Returns the product of a double-double-precision floating point number and a double.

Link copied to clipboard

Computes the Delaunay triangulation for the list of 2D points.

Link copied to clipboard

Returns the difference and exact error of subtracting two floating point numbers. Uses an EFT (error-free transformation), i.e. a-b === x+y exactly. The returned result is a non-overlapping expansion (smallest value first!).

Link copied to clipboard

Returns the sum and exact error of adding two floating point numbers. Uses an EFT (error-free transformation), i.e. a+b === x+y exactly. The returned sum is a non-overlapping expansion (smallest value first!).

Link copied to clipboard
fun orient2d(bx: Double, by: Double, ax: Double, ay: Double, cx: Double, cy: Double): Double
Link copied to clipboard
fun quicksort(ids: IntArray, dists: DoubleArray, left: Int, right: Int)
Link copied to clipboard

Truncates a floating point value's significand and returns the result. Similar to split, but with the ability to specify the number of bits to keep.

Link copied to clipboard
fun ShapeProvider.smoothScatter(placementRadius: Double, distanceToEdge: Double = placementRadius * 2.0, iterations: Int = 10, smoothing: Double = 0.5, random: Random = Random.Default): List<Vector2>
Link copied to clipboard
fun ShapeProvider.smoothScatterSeq(placementRadius: Double, distanceToEdge: Double = placementRadius * 2.0, smoothing: Double = 0.5, random: Random = Random.Default): Sequence<List<Vector2>>
Link copied to clipboard
fun ShapeProvider.smoothScatterWeightedSeq(placementRadius: Double, distanceToEdge: Double = placementRadius * 2.0, smoothing: Double = 0.5, random: Random = Random.Default): Sequence<List<Vector2>>
Link copied to clipboard

Returns the result of splitting a double into 2 26-bit doubles.

Link copied to clipboard

Returns the exact result of subtracting b from a.

Link copied to clipboard

Returns the exact result of multiplying two doubles.

Link copied to clipboard
Link copied to clipboard

Returns the exact result of adding two doubles.

Link copied to clipboard
fun List<Vector2>.voronoiDiagram(bounds: Rectangle = this.bounds): VoronoiDiagram

Generates a Voronoi diagram based on the points in the list and the provided bounds.