Skip to content

ajon542/ConvexHullNodeJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8b5b93b Â· May 13, 2015

History

16 Commits
May 13, 2015
May 13, 2015
May 13, 2015
May 2, 2015
May 13, 2015
May 4, 2015
May 2, 2015
May 5, 2015
May 5, 2015
May 5, 2015
May 2, 2015
May 5, 2015

Repository files navigation

ConvexHull

Finds the convex hull given a set of points.

Example

var convexHull = require('./convexhull.js');

// Create some initial points.
var initialPoints =
    [
        { x: 10, y: 10 },
        { x: 50, y: 10 },
        { x: 5, y: 30 },
        { x: 50, y: 60 },
    ];

// Calculate convex hull.
var pointsOnHull = convexHull(initialPoints);

// Log output.
console.log(pointsOnHull)

Output:

[ { x: 10, y: 10 },
  { x: 50, y: 10 },
  { x: 50, y: 60 },
  { x: 5, y: 30 } ]

Install

This module works in node.js.

API

var pointsOnHull = convexHull(initialPoints);

var pointsOnHull = convexHull(initialPoints)

The default method from the package calculate the convex hull, given a set of points.

  • initialPoints is an array of points.

Returns The set of points on the convex hull.

Notes and references

About

Convex Hull in javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published