{"id":20602978,"url":"https://github.com/potato-development/linear-line-area","last_synced_at":"2025-05-10T00:31:27.912Z","repository":{"id":262105727,"uuid":"886227952","full_name":"Potato-Development/linear-line-area","owner":"Potato-Development","description":"Converging area under a generic linear function between an upper and lower bound.","archived":false,"fork":false,"pushed_at":"2024-11-10T15:32:59.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-10T15:38:34.288Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Potato-Development.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-10T14:34:57.000Z","updated_at":"2024-11-10T15:33:17.000Z","dependencies_parsed_at":"2024-11-10T15:51:15.512Z","dependency_job_id":null,"html_url":"https://github.com/Potato-Development/linear-line-area","commit_stats":null,"previous_names":["potato-development/linear-line-area"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Potato-Development%2Flinear-line-area","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Potato-Development%2Flinear-line-area/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Potato-Development%2Flinear-line-area/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Potato-Development%2Flinear-line-area/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Potato-Development","download_url":"https://codeload.github.com/Potato-Development/linear-line-area/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224896139,"owners_count":17388069,"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":[],"created_at":"2024-11-16T09:15:17.854Z","updated_at":"2024-11-16T09:15:18.546Z","avatar_url":"https://github.com/Potato-Development.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# linear-line-area\nConverging area under a generic linear function between an upper and lower bound.\n\n![image](https://github.com/user-attachments/assets/935c9a7b-50dc-4e34-804a-e97d987820fb)\n\n## Introduction\nThe program finds the **_area_** under (or over) a generic function, $f(x)$ (which is linear for now, just to simplify things) and $a, b$ as the upper and lower bounds to find $S$. It does this by what I call \"slicing\" $b-a$ $n$ times; increasing $n$ will increase the accuracy of $s$ as it converges to the real area. This leaves $n$ rectangles which **_overestimate_** $S$, each\n\n$$f(a + \\frac{b}{n} k)$$ \n\nhigh, and  \n\n$$\\frac{b-a}{n}$$\n\nwide, where $k$ (1..=n) represents _which_ rectangle.\n\nThis leaves us with\n\n$$\n\\sum_{k=1}^{n} f\\left(a + \\frac{b}{n} k\\right) \\cdot \\frac{b}{n}\n$$\n\nto find the total area, which evaluates to\n\n$$\n\\sum_{k=1}^{n} \\left((a + \\frac{b}{n} k)m + c\\right)\\cdot \\frac{b}{n}\n$$\n\nfor $y = mx + c$.\n\n## Installation\nPrebuilt binaries for `Linux amd64`, `Linux aarch64` and `Windows 64-bit` are provided in [releases](https://github.com/Potato-Development/linear-line-area/releases). If anyone can cross-compile for MacOS, that would be greatly appreciated; I build and compile on a Raspberry Pi.\nIf none of the binaries support your architecture, the binaries don't work, or you want to build from source, then clone the repo for the source code. The code is a single source file at:\n\n```\n/path/to/linear-line-area/src/main.cpp\n```\n\nIt should compile with any toolchain without warnings. If you want to use my custom `Makefile`, you can find it in the project folder `/path/to/linear-line-area/Makefile`. Targets `all`, `clean`, and then individual targets for your architecture should be available. You may have to create the `target` folder yourself, please read the code carefully.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotato-development%2Flinear-line-area","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotato-development%2Flinear-line-area","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotato-development%2Flinear-line-area/lists"}