Add graham_scan definitions

This commit is contained in:
Harm Berntsen
2015-11-12 14:00:48 +01:00
parent 708609e076
commit 1971328701
2 changed files with 20 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
/// <reference path="graham_scan.d.ts" />
// Based on the README.MD
//Create a new instance.
var convexHull = new ConvexHullGrahamScan();
//add points (needs to be done for each point, a foreach loop on the input array can be used.)
convexHull.addPoint(1, 2);
//getHull() returns the array of points that make up the convex hull.
var hullPoints = convexHull.getHull();
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for graham_scan v1.0.2
// Project: https://github.com/brian3kb/graham_scan_js
// Definitions by: Harm Berntsen <https://github.com/hberntsen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class ConvexHullGrahamScan {
addPoint(x: number, y: number): void;
getHull(): {x: number, y: number}[];
}