# curvereduce

> Curve simplification per Ramer-Douglas-Peucker.

Latest version **1.0.0** (published 2022-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install curvereduce
pnpm add curvereduce
yarn add curvereduce
bun add curvereduce
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-08-10 |
| First published | 2021-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ian Cooper |
| Maintainers | icooper |

## Links

- npm: https://www.npmjs.com/package/curvereduce
- Repository: https://github.com/icooper/curvereduce-js
- Issues: https://github.com/icooper/curvereduce-js/issues
- npm.io page: https://npm.io/package/curvereduce

## Recent versions

- 1.0.0 (latest) — 2022-08-10
- 0.0.4 — 2021-03-01
- 0.0.3 — 2021-02-26
- 0.0.1 — 2021-02-26

## README

# CurveReduce

This is an implementation of the [Ramer-Douglas-Peucker (RDP) curve simplification algorithm](https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm) in TypeScript.

## Usage

Install from the NPM package repository using `npm install --save curvereduce`.

```typescript
import { Point, Simplify, SimplifyTo } from 'curvereduce';

const points: Point[] = [
    { x: 1.20401E-09, y: -0.00120428 },
    { x: 0.018, y: 0.241799 },
    { x: 0.1044, y: 1.34392 },
    ...
];

// use an explicit epsilon value
let simplified1 = Simplify(points, 0.1075);

// or specify a number of points you want to end up with
let simplified2 = SimplifyTo(points, 20);
```
## License

This work is licensed under the [MIT License](../LICENSE.md).

## Credits

This RDP algorithm implementation is heavily influenced by [Marius Karthaus's JavaScript implementation](https://karthaus.nl/rdp/).

---
_Source: https://npm.io/package/curvereduce · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
