{"id":18047195,"url":"https://github.com/jw3126/linearinterpolations.jl","last_synced_at":"2025-04-10T05:05:40.183Z","repository":{"id":48862968,"uuid":"351244562","full_name":"jw3126/LinearInterpolations.jl","owner":"jw3126","description":"Linear interpolate almost anything","archived":false,"fork":false,"pushed_at":"2022-10-28T12:46:59.000Z","size":53,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T05:05:28.912Z","etag":null,"topics":["interpolation","julia"],"latest_commit_sha":null,"homepage":"","language":"Julia","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/jw3126.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":"2021-03-24T22:49:41.000Z","updated_at":"2024-05-15T00:08:13.000Z","dependencies_parsed_at":"2022-09-03T13:53:00.393Z","dependency_job_id":null,"html_url":"https://github.com/jw3126/LinearInterpolations.jl","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jw3126%2FLinearInterpolations.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jw3126%2FLinearInterpolations.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jw3126%2FLinearInterpolations.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jw3126%2FLinearInterpolations.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jw3126","download_url":"https://codeload.github.com/jw3126/LinearInterpolations.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161273,"owners_count":21057555,"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":["interpolation","julia"],"created_at":"2024-10-30T19:10:35.757Z","updated_at":"2025-04-10T05:05:40.164Z","avatar_url":"https://github.com/jw3126.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LinearInterpolations\n\n[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://jw3126.github.io/LinearInterpolations.jl/stable)\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://jw3126.github.io/LinearInterpolations.jl/dev)\n[![Build Status](https://github.com/jw3126/LinearInterpolations.jl/workflows/CI/badge.svg)](https://github.com/jw3126/LinearInterpolations.jl/actions)\n\n# Why?\nThere are many excellent packages for interpolation in Julia. For instance:\n* [Interpolations.jl](https://github.com/JuliaMath/Interpolations.jl)\n* [Dierckx.jl](https://github.com/kbarbary/Dierckx.jl)\n* [GridInterpolations.jl](https://github.com/sisl/GridInterpolations.jl)\n\nAll packages I am aware of assume, that the objects being interpolated implement addition and\nscalar multiplication. However mathematically only a notion of weighted average is required for linear interpolation.\nExamples of objects that support weighted average, but not addition and/or scalar multiplication are:\n* Probability distributions\n* Rotations and various other Lie groups\n\nThis package works with any notion of weighted average.\n\n# Usage\n\n```julia\njulia\u003e using LinearInterpolations\n\njulia\u003e xs = 1:3; ys=[10, 100, 1000]; # 1d\n\njulia\u003e interpolate(xs, ys, 1)\n10.0\n\njulia\u003e interpolate(xs, ys, 1.5)\n55.0\n\njulia\u003e pt = [1.5]; interpolate(xs, ys, pt)\n55.0\n\njulia\u003e itp = Interpolate(xs, ys); # construct a callable for convenience\n\njulia\u003e itp(1.5)\n55.0\n\njulia\u003e grid=(1:3, [10, 15]); vals = [1 2; 3 4; 5 6]; pt=[1,10]; # multi dimensional\n\njulia\u003e interpolate(grid, vals, pt)\n1.0\n\njulia\u003e function winner_takes_it_all(wts, objs)\n    # custom notion of weighted average\n    I = argmax(wts)\n    return objs[I]\nend\n\njulia\u003e xs = 1:4; ys=[:no, :addition, :or, :multiplication];\n\njulia\u003e interpolate(xs, ys, 1.1, combine=winner_takes_it_all)\n:no\n\njulia\u003e interpolate(xs, ys, 1.9, combine=winner_takes_it_all)\n:addition\n\njulia\u003e interpolate(xs, ys, 3.7, combine=winner_takes_it_all)\n:multiplication\n```\n\n# Design goals\n\n* Lightweight and simple\n* Support interpolation of objects that don't define `+,*`\n* Reasonable performance\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjw3126%2Flinearinterpolations.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjw3126%2Flinearinterpolations.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjw3126%2Flinearinterpolations.jl/lists"}