{"id":21908751,"url":"https://github.com/mbn-code/newton-raphsons-root-finder","last_synced_at":"2025-03-22T07:47:47.384Z","repository":{"id":223956397,"uuid":"750432123","full_name":"mbn-code/Newton-Raphsons-Root-Finder","owner":"mbn-code","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-18T09:02:47.000Z","size":9008,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-27T08:11:38.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbn-code.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-01-30T16:28:03.000Z","updated_at":"2024-02-23T13:48:00.000Z","dependencies_parsed_at":"2024-03-18T09:50:01.597Z","dependency_job_id":"158d93fd-5fa2-489c-8d84-3d80972a71d8","html_url":"https://github.com/mbn-code/Newton-Raphsons-Root-Finder","commit_stats":null,"previous_names":["mbn-code/newton-raphsons-root-finder"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbn-code%2FNewton-Raphsons-Root-Finder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbn-code%2FNewton-Raphsons-Root-Finder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbn-code%2FNewton-Raphsons-Root-Finder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbn-code%2FNewton-Raphsons-Root-Finder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbn-code","download_url":"https://codeload.github.com/mbn-code/Newton-Raphsons-Root-Finder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244924753,"owners_count":20532873,"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-28T17:13:48.530Z","updated_at":"2025-03-22T07:47:47.365Z","avatar_url":"https://github.com/mbn-code.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Comprehensive Newton-Raphson Method Implementations\n\nWelcome to my repository dedicated to providing robust implementations of the Newton-Raphson method across multiple programming languages, namely JavaScript, Python, and Rust. The Newton-Raphson method is a well-known root-finding algorithm that employs iteration to accurately determine the roots of a real-valued function.\n\n![Third Degree Polynomial](polynomium_of_third_degree.png)\n\n## Table of Contents\n\n- [Detailed Introduction](#detailed-introduction)\n- [In-depth Project Structure](#in-depth-project-structure)\n- [Comprehensive Getting Started Guide](#comprehensive-getting-started-guide)\n    - [Prerequisites](#prerequisites)\n    - [Installation](#installation)\n\n## Detailed Introduction\n\nThe Newton-Raphson method is a highly effective numerical technique used for finding the roots of a real-valued function. It leverages the concept that a continuous and differentiable function can be approximated by a straight line tangent to it. This repository offers comprehensive implementations of the Newton-Raphson method in JavaScript, Python, and Rust, providing a valuable resource for those interested in numerical methods and their applications.\n\n## In-depth Project Structure\n\nThis project is meticulously structured to provide clear and organized access to the various implementations:\n\n## Project Structure\n\nThe project is structured as follows:\n\n- [`src_js/`](src_js/): Contains JavaScript implementations of the Newton-Raphson method.\n    - [`newton.js`](src_js/newton.js): A simple implementation of the Newton-Raphson method.\n    - [`newton_rec.js`](src_js/newton_rec.js): A recursive implementation of the Newton-Raphson method.\n    - [`newton_rec_benchmark.test.js`](src_js/newton_rec_benchmark.test.js): A benchmark test for the recursive implementation.\n    - [`package.json`](src_js/package.json): Defines the JavaScript project and its dependencies.\n- [`src_python/`](src_python/): Contains Python implementations of the Newton-Raphson method.\n    - [`newton.py`](src_python/newton.py): A simple implementation of the Newton-Raphson method.\n    - [`newton_rec.py`](src_python/newton_rec.py): A recursive implementation of the Newton-Raphson method.\n    - [`newton_rec_benchmark.py`](src_python/newton_rec_benchmark.py): A benchmark test for the recursive implementation.\n    - [`analysis_javascript.py`](src_python/analysis_javascript.py): Analysis script for JavaScript implementation.\n    - [`analysis_python.py`](src_python/analysis_python.py): Analysis script for Python implementation.\n- [`src_rust/`](src_rust/): Contains a Rust implementation of the Newton-Raphson method.\n    - [`newton_rec/`](src_rust/newton_rec/): A recursive implementation of the Newton-Raphson method.\n        - [`src/main.rs`](src_rust/newton_rec/src/main.rs): The main Rust source file.\n        - [`Cargo.toml`](src_rust/newton_rec/Cargo.toml): Defines the Rust project and its dependencies.\n\n## Getting Started\n\n### Prerequisites\n\nBefore you can run the code in this repository, you need to have the following installed:\n\n- Node.js and npm: You can download and install them from [here](https://nodejs.org/).\n- Python: You can download and install it from [here](https://www.python.org/downloads/).\n- Rust and Cargo: You can download and install them from [here](https://www.rust-lang.org/tools/install).\n\n### Installation\n\n1. Clone the repository:\n\n```sh\ngit clone https://github.com/mbn-code/newton-raphson-root-finder.git\n```\n\n2. Navigate into the project directory\n\n```sh\ncd newton-raphson-root-finder\n```\n\n3. Insatll the neccessary p5 extensions ( using vscode )\n\n    3.1 windows `ctrl + shift + x` to go to extensions\n    3.1 macOS `command + shift + x` to go to extensions\n\n    3.2 search `live p5` and install the following:\n    \n    ![live-p5](live-p5.PNG) \n\n**Running The Visualisation part**\n\nTo run the visual part of this demonstration we focus on the `newton.js` file. \nThis file contains the implementation of newton raphson method in p5\n\nTo run the simulation use the shortcut `ctrl + shift + p` or `command + shift + p` and type `Open live p5 panel` To get the panel to show, to load a new random polynomium (graph) use the shortcut `ctrl + s` or `command + s` which saves the file, and acts as reloading the live preview and running the script.\n\n[![Visualisation of Newton Method](https://img.youtube.com/vi/oK0CTj7sJvo/0.jpg)](https://www.youtube.com/watch?v=oK0CTj7sJvo)\n\n**Running the terminal scripts**\n\nTo run the javascript code simiple use `node src_js/newton_rec.js`, this is the recursive implementation of the newton raphson method which shows the method in a recursive manner.\nThe benchmarking script related to the `newton_rec.js` is the `newton_rec_benchmark.test.js` which is a javascript test file to test `n` amount of different functions (based on how many there are in the array) and benchmark the time it takes to find a root, based on x0 initial guess. \n\nWhen running rust you use `cargo run` in the `src_rust/newton_rec` project folder\n\n**Running the python visualisation**\n\nUse `python src_python/newton.py` when running the visualisation. \n\n**Contact Information**\n\n- Email: malthe@mbn-code.dk\n- Website: [mbn-code.dk](https://mbn-code.dk)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbn-code%2Fnewton-raphsons-root-finder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbn-code%2Fnewton-raphsons-root-finder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbn-code%2Fnewton-raphsons-root-finder/lists"}