Giter Site home page Giter Site logo

anthonytjio / series-reducer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lukaszwiktor/series-reducer

0.0 2.0 0.0 25 KB

A java implementation of Ramer–Douglas–Peucker algorithm for reducing number of points in data series.

License: Apache License 2.0

Java 100.00%

series-reducer's Introduction

series-reducer

A java implementation of Ramer–Douglas–Peucker algorithm for reducing number of points in data series.

How it works?

The algorithm removes points from the series while maintaining the shape of the curve. See an example below:

example 1

How to use it?

All you need to do is to invoke SeriesReducer.reduce(points, epsilon) where points is an ordered list of points and epsilon defines a margin within which points can be removed.

Data presented on the example charts were produced by the following code snippet:

List<Point> points = new ArrayList<Point>();
for (double x = 0; x < 4; x += 0.05) {
    points.add(new MyPoint(x, Math.cos(x*x - 1)));
}
List<Point> reduced = SeriesReducer.reduce(points, 0.01);

series-reducer's People

Contributors

lukaszwiktor avatar

Watchers

James Cloos avatar Anthony Prasetyo 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.