Coder Social home page Coder Social logo

php-convexhull's Introduction

PHP Convex Hull

Simple PHP implementation of the "Andrew's Monotone Chain" convex hull algorithm

$input = [
	[ -1.4227294921875, 52.19413974159753 ],
	[ -2.1148681640624996, 51.88666357770388 ],
	[ -1.69189453125, 51.879882095410224 ],
	[ -2.0709228515625, 51.2928411273273 ],
	[ -1.1151123046875, 51.155231611562265 ],
	[ -1.4666748046875, 51.57706953722567 ],
	[ -0.5548095703125, 51.64870258356996 ],
	[ -1.1920166015625, 51.84595933666338 ],
	[ -0.648193359375, 52.11325243469631 ],
	[ -1.285400390625, 52.55965567958736 ],
	[ -1.4227294921875, 52.19413974159753 ]
];

$output = convexHull($input);

/*
	-2.11486816406, 51.8866635777
	-2.07092285156, 51.2928411273
	-1.11511230469, 51.1552316116
	-0.554809570312, 51.6487025836
	-0.648193359375, 52.1132524347
	-1.28540039062, 52.5596556796
	-2.11486816406, 51.8866635777
*/

php-convexhull's People

Contributors

benpoulson avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.