Giter Site home page Giter Site logo

interpolate's Introduction

.interpolate()

Lagrange interpolation visualizer

Lagrange interpolation is a mathematical method for creating a polynomial function whose graphs passes through a fixed collection of points. The result is the polynomial function of least degree that passes through the given points, known as a Lagrange polynomial. This visualizer allows you to manipulate the point set of a Lagrange polynomial in real-time, and observe how the polynomial changes. It also has a "free" mode where the points will move on their own.

Main Options

  • # of polynomials: how many Lagrange polynomials to graph, 1 or 2.
  • Interpolation mode: static or free. Static allows you to drag the points around and watch the graph change. Free will randomly shift the points within certain parameters, often producing interesting visuals.
  • Show axes: whether to hide or show the x- and y-axes. The x-axis crosses the center of the viewing area, while the y-axis is the left edge. Note that translating a set of points together simply translates the Lagrange polynomial by the same amount, so the position of the origin is essentially irrelevant.
  • Show points: whether to show the point set being used to create the Lagrange polynomial. When in "static" mode, this box is automatically checked.
  • Graphing style: Line or filled. Line graphs the polynomial(s) normally, filled shows either the area beneath the graph (if graphing one polynomial), or the area between the graphs (if graphing two polynomials).

Polynomial Options

Each polynomial has its options set separately, with additional options for free mode.

  • Interpolation points: how many points should be used to form each polynomial, from 2 to 9. Note that Lagrange polynomials have degree one less than the number of points used.
  • Speed (free mode only): how quickly the polynomial will change.
  • Motion (free mode only): algorithm for determining how the polynomial changes over time. The "bands" option moves each point in the generating set for the polynomial within a vertical band, while "random" will move each point to an arbitrary new point. Lagrange polynomial behavior is most erratic when two of the generating points have close x values, and the sign of the polynomial flips every time one point crosses another. Since in the "bands" option, the interpolation points never cross, it produces much more stable motion than the "random" option.

Credits

Created by Louis Webb with libGDX, licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

interpolate's People

Contributors

l-e-webb avatar

Stargazers

 avatar

Watchers

 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.