{"id":16608889,"url":"https://github.com/constantor/complex-numbers","last_synced_at":"2025-06-21T11:07:45.315Z","repository":{"id":121174776,"uuid":"49357232","full_name":"Constantor/complex-numbers","owner":"Constantor","description":"Class that provides using complex numbers on PHP.","archived":false,"fork":false,"pushed_at":"2016-01-28T12:05:45.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T15:11:41.054Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Constantor.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":"2016-01-10T07:09:59.000Z","updated_at":"2021-06-08T20:44:01.000Z","dependencies_parsed_at":"2023-04-22T12:30:17.250Z","dependency_job_id":null,"html_url":"https://github.com/Constantor/complex-numbers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Constantor/complex-numbers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constantor%2Fcomplex-numbers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constantor%2Fcomplex-numbers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constantor%2Fcomplex-numbers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constantor%2Fcomplex-numbers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Constantor","download_url":"https://codeload.github.com/Constantor/complex-numbers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constantor%2Fcomplex-numbers/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261110612,"owners_count":23111064,"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-10-12T01:27:27.922Z","updated_at":"2025-06-21T11:07:40.303Z","avatar_url":"https://github.com/Constantor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Complex numbers class\nThe class providing you to use complex numbers.\n\nThis class support many main things to work with imaginary numbers, for example\n\n  - add real and complex number\n  - add complex with complex number\n  - multiply real and complex number\n  - multiply complex and complex number\n  - divide complex by real\n  - divide complex by complex\n  - divide real by complex\n  - power complex number by real exponent (negative and fraction too)\n  - get integer root of complex number\n  - get argument of complex number\n  - get module (absolute) of complex number\n\n### How to use\nInclude the class file in your code. Than you need create as many numbers as you need. Complex numbers in the class have the form a+b*i, where a and b is real and i is imaginary unit. To create complex number use code like this:\n```php\n...\n$complexNumber1 = new complexNumber($a, $b);\n...\n```\nThere are many methods to manipulate with created number, class structure:\n```php\nclass complexNumber {\n\tpublic var $a, $b; // a and b from a+b*i\n\n\tboolean public function __construct(numeric $a, numeric $b) { ... } // Initialize class\n\n\tstring public function getNumber() { ... } // Returns $a.'+'.$b.'*i'\n\n\tcomplexNumber public function add(numeric/complexNumber $number) { ... } // Add $number to your complex number\n\n\tcomplexNumber public function sub(numeric/complexNumber $number) { ... } // Subtract $number to your complex number\n\n\tcomplexNumber public function multiply(numeric/complexNumber $number) { ... } // Multiply $number to your complex number\n\n\tcomplexNumber public function divide(numeric/complexNumber $number) { ... } // Divide $number to your complex number\n\n\tfloat public function absolute() { ... } // Get an absolute (module) of the complex number\n\n\tfloat public function argument() { ... } // Get an argument of the complex number\n\n\tcomplexNumber public function power(numeric $number) { ... } // Power your complex number by $exponent\n\n\tcomplexNumber public function root(int $base, $k = 0 /* Number of root (there are $base of them) */) { ... } // Make $base`s root of complex number\n}\n```\n\n### Version\n2.1\n\nLicense\n----\n\n[Apache License](http://www.apache.org/licenses/)\n\n---\n##### Stepan Konstantinov\nI am on \n\n[VKontakte](http://vk.com/stepankonstantinovboss)\n\n[CodeForces](http://codeforces.com/profile/Constantor)\n\n[FightCode](http://fightcodegame.com/profile/NaiKoNGod/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstantor%2Fcomplex-numbers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconstantor%2Fcomplex-numbers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstantor%2Fcomplex-numbers/lists"}