Skip to content

Instantly share code, notes, and snippets.

View InI4's full-sized avatar
🌴
Looking for lib updates.

InI4

🌴
Looking for lib updates.
View GitHub Profile
@InI4
InI4 / modRDP.php
Last active August 27, 2018 21:19
A flexible Modification of the Ramer Douglas Peucker Algorithm.
<?php
/**
* An implementation of a modified Ramer-Douglas-Peucker algorithm for reducing
* the number of points on a polyline (aka polygonal chain aka track).
* https://en.wikipedia.org/wiki/Polygonal_chain
*
* For more information, see:
* http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm
*
* Main change is how to measure distance between a connection (aka line, reference)