PHPackages                             benovermyer/voronoi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. benovermyer/voronoi

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

benovermyer/voronoi
===================

Generate Voronoi polygons using Fortune's algorithm

0.1.0(5y ago)327MITPHPPHP &gt;=7.4.0

Since Sep 24Pushed 5y agoCompare

[ Source](https://github.com/BenOvermyer/voronoi)[ Packagist](https://packagist.org/packages/benovermyer/voronoi)[ RSS](/packages/benovermyer-voronoi/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

PHP implementation of Steven Fortune's Voronoï algorithm.
=========================================================

[](#php-implementation-of-steven-fortunes-voronoï-algorithm)

This lets you create Voronoï graphs automatically by computing the polygon coordinates based on a set of points.

It was originally written by Samuel Roze based on a JavaScript library by Raymond Hill.

Example Usage
-------------

[](#example-usage)

To generate polygons, you need to have a *bounding box* that will define the box within you'll compute your graph. Then, you need some points. Here's a simple snippet that generate random points, and them compute the polygons.

For a more complete example, check out the file `sample/voronoi.php`.

Note that bounding box is in the var `$bbox`, and points in `$sites`.

```
