smooth-polyline
Smoothing algorithm for 2D lines and polygons
Install
CDN
Recommended: https://unpkg.com/smooth-polyline, which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at https://unpkg.com/smooth-polyline/
NPM
npm install smooth-polyline --save
Yarn
yarn add smooth-polyline
Bower
bower install smooth-polyline --save
Development Setup
# install dependenciesnpm install# build dist filesnpm run build
Usage
var smoothLine = ; /* return [ [1,1], [1,1.15], [1,1.8499999999999999], [1.15,2], [1.8499999999999999,2], [2,1.8499999999999999], [2,1.15], [2,1] ] */
var smoothLine = ; /* return [ [1,1], [1,1.0225], [1,1.1275], [1,1.255], [1,1.7449999999999997], [1.0225,1.8724999999999998], [1.1275,1.9775], [1.255,2], [1.7449999999999997,2], [1.8724999999999998,1.9775], [1.9775,1.8724999999999998], [2,1.7449999999999997], [2,1.255], [2,1.1275], [2,1.0225], [2,1] ] */
License
MIT © Igor Ognichenko