mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #6731 from hberntsen/graham_scan
Add graham_scan definitions
This commit is contained in:
@@ -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();
|
||||
Vendored
+8
@@ -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}[];
|
||||
}
|
||||
Reference in New Issue
Block a user