{"id":25963322,"url":"https://github.com/systemsoftware/taylor-series-cli","last_synced_at":"2026-04-16T17:37:52.336Z","repository":{"id":280567629,"uuid":"942429428","full_name":"systemsoftware/taylor-series-cli","owner":"systemsoftware","description":"This is a Node.js CLI tool that calculates and displays the Taylor series expansion of a given function at a specified point. The program computes derivatives, evaluates terms, and formats the result in a human-readable way, including colored output for better readability.","archived":false,"fork":false,"pushed_at":"2025-03-04T05:08:12.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T06:20:23.165Z","etag":null,"topics":["calculator","calculus","nodejs","taylor-series"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/systemsoftware.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":"2025-03-04T05:07:37.000Z","updated_at":"2025-03-04T05:08:49.000Z","dependencies_parsed_at":"2025-03-04T06:20:27.460Z","dependency_job_id":"c835b8fe-7d69-42ac-9f98-8213ee43c03f","html_url":"https://github.com/systemsoftware/taylor-series-cli","commit_stats":null,"previous_names":["systemsoftware/taylor-series-cli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsoftware%2Ftaylor-series-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsoftware%2Ftaylor-series-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsoftware%2Ftaylor-series-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsoftware%2Ftaylor-series-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemsoftware","download_url":"https://codeload.github.com/systemsoftware/taylor-series-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241917236,"owners_count":20042061,"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":["calculator","calculus","nodejs","taylor-series"],"created_at":"2025-03-04T20:29:52.097Z","updated_at":"2025-10-05T01:41:21.343Z","avatar_url":"https://github.com/systemsoftware.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Taylor Series Expansion CLI**\n\nThis is a **Node.js CLI tool** that calculates and displays the **Taylor series expansion** of a given function at a specified point. The program computes derivatives, evaluates terms, and formats the result in a human-readable way, including **colored output** for better readability.\n\n## **Features**\n✅ Computes **Taylor series expansion** of a given function.  \n✅ Allows specifying the **point of expansion (a)** and **number of terms (n)**.  \n✅ Supports **automatic differentiation** using `mathjs`.  \n✅ Uses **color-coded output** via `chalk`.  \n✅ Dynamically adjusts **terminal width** for better display.  \n\n\n\n## **Installation**\n1. Clone this repository or download the file:\n   ```sh\n   git clone https://github.com/systemsoftware/taylor-series-cli.git\n   cd taylor-series-cli\n   ```\n2. Install dependencies:\n   ```sh\n   npm install\n   ```\n\n\n\n## **Usage**\nRun the script using:\n```sh\nnode . \"\u003cfunction\u003e\" \u003ca\u003e \u003cn\u003e\n```\nWhere:\n- `\"\u003cfunction\u003e\"` is the mathematical function (default: `\"sin(x)\"`)\n- `\u003ca\u003e` is the expansion point (default: `0`)\n- `\u003cn\u003e` is the number of terms in the Taylor series (default: `10`)\n\n### **Example Commands**\n```sh\nnode . \"sin(x)\" 5 10\n```\nExpands `sin(x)` around `x = 5` with `10` terms.\n\n```sh\nnode . \"e^x\" 1 5\n```\nExpands `e^x` at `x = 1` using `5` terms.\n\n```sh\nnode . \"sin(x)e^x\" 1 7\n```\nExpands `sin(x)e^x` at `x = 1` using `7` terms.\n\n\n```sh\nnode . \"cos(4x)\" 0 4\n```\nExpands `cos(4x)` at `x = 0` using `4` terms.\n\n\n\n## **Example Output**\n```sh\nsin(x) around 0 with 5 non-zero terms (10 max terms)\n\nsin(x) ≈ x^1 - 1/6x^3 + 1/120x^5 - 0.000198x^7 + 0.000003x^9\n\n```\n\n\n\n## **How It Works**\n1. **Computes derivatives** of the function using `math.derivative()`.\n2. **Evaluates** each derivative at `x = a`.\n3. **Divides by factorial** to compute the Taylor coefficient.\n4. **Formats terms** using `formatTerm()` to maintain readability.\n5. **Colors the output** using `chalk` for better visualization.\n6. **Adjusts line width** dynamically based on `process.stdout.columns`.\n\n\n\n## **Dependencies**\n- **[mathjs](https://www.npmjs.com/package/mathjs)** → For symbolic differentiation and evaluation.\n- **[chalk](https://www.npmjs.com/package/chalk)** → For color-coded terminal output.\n\n\n\n## **License**\nThis project is **open-source** under the MIT License.\n\n\n\n## **Contributing**\nFeel free to fork and improve the project! 🚀  \nIf you find a bug or have a feature request, **open an issue**.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemsoftware%2Ftaylor-series-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemsoftware%2Ftaylor-series-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemsoftware%2Ftaylor-series-cli/lists"}