{"id":18765824,"url":"https://github.com/nifadyev/cubic-spline-interpolator","last_synced_at":"2025-04-13T05:30:31.212Z","repository":{"id":37695923,"uuid":"222508677","full_name":"nifadyev/cubic-spline-interpolator","owner":"nifadyev","description":"Interpolate cubic spline using tridiagonal matrix algorithm ","archived":false,"fork":false,"pushed_at":"2023-07-06T21:56:47.000Z","size":176,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T22:11:40.551Z","etag":null,"topics":["matplotlib","numpy","scipy","spline-interpolation","splines"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nifadyev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-18T17:46:10.000Z","updated_at":"2024-04-17T18:21:07.000Z","dependencies_parsed_at":"2022-09-13T17:21:48.363Z","dependency_job_id":null,"html_url":"https://github.com/nifadyev/cubic-spline-interpolator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nifadyev%2Fcubic-spline-interpolator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nifadyev%2Fcubic-spline-interpolator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nifadyev%2Fcubic-spline-interpolator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nifadyev%2Fcubic-spline-interpolator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nifadyev","download_url":"https://codeload.github.com/nifadyev/cubic-spline-interpolator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670166,"owners_count":21142895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matplotlib","numpy","scipy","spline-interpolation","splines"],"created_at":"2024-11-07T18:36:51.859Z","updated_at":"2025-04-13T05:30:31.184Z","avatar_url":"https://github.com/nifadyev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cubic Spline Interpolator\n\n![](https://img.shields.io/badge/python-v3.8-blue) ![](https://img.shields.io/badge/numpy-1.18.2-blue) ![](https://img.shields.io/badge/scipy-1.4.1-blue) ![](https://img.shields.io/badge/matplotlib-3.2.1-blue) ![](https://img.shields.io/badge/platform-windows%20%7C%20linux-lightgrey) ![](https://img.shields.io/badge/license-MIT-green)\n\nTool for building splines based on pre-calculated (x, y) set of points.\n\n## Requirements\n- python3.8+\n- pip\n- virtualenv (optional)\n\n### Pip packages\nInstall required packages using `virtualenv`\n\n```bash\npython -m virtualenv env \u0026\u0026 source env/bin/activate\npython -m pip install -r requirements.txt\n```\n\n## Usage\n\nThe script can be run as:\n\n`python main.py --options`\n\nThe set of available options are:\n\n * `--range_start`: left range boundary, default=-10.0, example: -7.5\n * `--range_end`: right range boundary, default=10.0, example: 5.0\n * `--range_length`: number of values in range, default=30000, example: 1000\n * `--intervals`: number of intervals, default=10, example: 50\n * `--compare_default/--do_not_compare`: compare custom spline with default `scipy` spline, default=False\n\n## Example\n\nSet range [-10.0, 20.0] with 50 intervals\n\n`python main.py --range_end 20 --intervals 50`\n\n### Output\n\nOutput contains:\n * function\n * first 8 pairs of arguments and function results\n * first 8 pairs of arguments and interpolated values\n * spline coefficients on each step\n * interpolation error\n\n```bash\nFunction arguments and results:\n\n x | -10.000 |  -9.999 |  -9.999 |  -9.998 |  -9.997 |  -9.997 |  -9.996 |  -9.995 |\n------------------------------------------------------------------------------------\n y |  -0.054 |  -0.054 |  -0.054 |  -0.054 |  -0.054 |  -0.054 |  -0.054 |  -0.053 |\n\nSpline arguments and interpolated values:\n\n x | -10.000 |  -9.999 |  -9.999 |  -9.998 |  -9.997 |  -9.997 |  -9.996 |  -9.995 |\n------------------------------------------------------------------------------------\n y |  -0.054 |  -0.054 |  -0.054 |  -0.054 |  -0.053 |  -0.053 |  -0.053 |  -0.053 |\n\nCoefficients on each step:\n\nStep|    x    |    a    |    b    |    c    |    d    \n------------------------------------------------------\n  1 | -10.000 |  -0.054 |   0.000 |   0.000 |   0.000\n  2 |  -7.778 |   0.126 |  -0.031 |  -0.152 |  -0.068\n  3 |  -5.556 |  -0.116 |  -0.095 |   0.094 |   0.111\n  4 |  -3.333 |  -0.052 |   0.172 |   0.146 |   0.023\n  5 |  -1.111 |   0.446 |   0.167 |  -0.150 |  -0.133\n  6 |   1.111 |   0.446 |  -0.167 |  -0.150 |  -0.000\n  7 |   3.333 |  -0.052 |  -0.172 |   0.146 |   0.133\n  8 |   5.556 |  -0.116 |   0.095 |   0.094 |  -0.023\n  9 |   7.778 |   0.126 |   0.031 |  -0.152 |  -0.111\n 10 |  10.000 |  -0.054 |  -0.137 |   0.000 |   0.068\n\nInterpolation error: 0.11198\n```\n\n### Plot\n\n#### 10 intervals\n\n![](./images/default_intervals.png)\n\n#### 30 intervals\n\n![](./images/30_intervals.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnifadyev%2Fcubic-spline-interpolator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnifadyev%2Fcubic-spline-interpolator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnifadyev%2Fcubic-spline-interpolator/lists"}