Giter Site home page Giter Site logo

cubicspline's Introduction

CubicSpline

Задача реализовать кубический сплайн. Пользователь забивает в программу точки с помощью кликов мыши, а по ним в реальном времени строится кривая. Можно добавить возможность перетаскивать точки (положение кривой обновляется), перетаскивать саму кривую и т.д.

Кубический сплайн был реализован в виде S(x) = fi * (t - 1)^2 * (2t + 1) + (fi+1) * t^2 * (3 - 2t) + mi*hi * t * (1 - t)^2 - (mi+1)*hi * t^2 * (1 - t), где t = (x - xi)/hi, hi = (xi+1 - xi), mi = S'(xi).

Условие непрерывности второй производной: S''((xi) - 0) = S''((xi) + 0). Представлено в виде: qi * (mi - 1) + 2mi + pi * (mi + 1) = 3 * (pi * ((fi+1) - fi)/hi + qi * (fi - (fi-1))/(hi-1)), где pi = (hi-1)/((hi-1) + hi), qi = 1 - pi = hi/((hi-1) + hi). Получается система уравнений с 3-мя неизвестными, находим их методом прогонки.

cubicspline's People

Contributors

ann-telegin avatar annusshka 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.