{"id":20226712,"url":"https://github.com/kailuser/complex-math-js","last_synced_at":"2025-10-12T03:35:22.313Z","repository":{"id":65971715,"uuid":"603745937","full_name":"KailUser/complex-math-js","owner":"KailUser","description":"NumJs is a npm/bower package for scientific computing with JavaScript. It contains among other things:","archived":false,"fork":false,"pushed_at":"2023-02-19T17:13:27.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T10:41:58.238Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KailUser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2023-02-19T13:08:30.000Z","updated_at":"2023-02-19T13:13:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"cebd67bc-f09b-45ce-b5e0-e70c85184dac","html_url":"https://github.com/KailUser/complex-math-js","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":"0.17647058823529416","last_synced_commit":"deddd48ffc2e37ea8254071b77d9eea906ca7d56"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KailUser%2Fcomplex-math-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KailUser%2Fcomplex-math-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KailUser%2Fcomplex-math-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KailUser%2Fcomplex-math-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KailUser","download_url":"https://codeload.github.com/KailUser/complex-math-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241670156,"owners_count":20000327,"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-14T07:19:48.928Z","updated_at":"2025-10-12T03:35:17.257Z","avatar_url":"https://github.com/KailUser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Complex Math JS\n\n![npm](https://img.shields.io/npm/v/complex-math-js?style=flat-square)\n![npm bundle size](https://img.shields.io/bundlephobia/min/complex-math-js?style=flat-square)\n![NPM](https://img.shields.io/npm/l/complex-math-js?style=flat-square)\n[![](https://data.jsdelivr.com/v1/package/npm/complex-math-js/badge)](https://www.jsdelivr.com/package/npm/complex-math-js)\n[![Documentation Status](https://readthedocs.org/projects/complex-math-js/badge/?version=latest)](https://complex-math-js.readthedocs.io/en/latest/?badge=latest)\n\nA lightweight JavaScript library for complex number arithmetic.\n\n## Installation\n\nYou can install `complex-math-js` using npm:\n\n```npm\n    npm install complex-math-js\n```\n\n## Usage\n\n```js\nconst { Complex, addComplexNumbers, subtractComplexNumbers, multiplyComplexNumbers, divideComplexNumbers } = require('complex-math-js');\n\nconst a = new Complex(1, 2);\nconst b = new Complex(3, 4);\n\nconsole.log(a.add(b));          // Output: 4 + 6i\nconsole.log(a.subtract(b));     // Output: -2 - 2i\nconsole.log(a.multiply(b));     // Output: -5 + 10i\nconsole.log(a.divide(b));       // Output: 0.44 + 0.08i\nconsole.log(a.magnitude());     // Output: 2.23606797749979\nconsole.log(a.conjugate());     // Output: 1 - 2i\n```\n\n### On site\n```html\n\u003cscript type=\"module\"\u003e \n    import complex-math-js from https://cdn.jsdelivr.net/npm/complex-math-js/+esm \n\u003c/script\u003e\n```\n## API\nComplex\n\nA class representing a complex number.\n\n## Constructor: \n\n`new Complex(real, imag)`: Creates a new complex number object with the given real and imaginary components.\n\n## Methods:\n`add(other)`: Returns a new Complex object that is the sum of this complex number and the other complex number.\n\n`subtract(other)`: Returns a new Complex object that is the difference between this complex number and the other complex number.\n\n`multiply(other)`: Returns a new Complex object that is the product of this complex number and the other complex number.\n\n`divide(other)`: Returns a new Complex object that is the quotient of this complex number and the other complex number.\n\n`magnitude()`: Returns the magnitude (absolute value) of this complex number.\n\n`conjugate()`: Returns a new Complex object that is the complex conjugate of this complex number.\n\n`toString()`: Returns a string representation of this complex number.\n\n## Functions\n `addComplexNumbers(a, b)`: Returns the sum of the a and b complex numbers.\n \n `subtractComplexNumbers(a, b)`: Returns the difference between the a and b complex numbers.\n \n `multiplyComplexNumbers(a, b)`: Returns the product of the a and b complex numbers.\n \n `divideComplexNumbers(a, b)`: Returns the quotient of the a and b complex numbers.\n \n## License\n\n![NPM](https://img.shields.io/npm/l/complex-math-js?style=flat-square)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkailuser%2Fcomplex-math-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkailuser%2Fcomplex-math-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkailuser%2Fcomplex-math-js/lists"}