{ "info": { "author": "Jean Franco G\u00f3mez", "author_email": "JeanFGomezR@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# AlComplex\n\nA Complex Number library. It uses its own complex number implementation. Its main goal it's to provide a more complete API, compared to the default complex number implementation in Python.\n\nIt's as simple as:\n\n```\n>>> from AlComplex import I, AlComplex, pi\n>>> 2 + 3*I\n2.0 + 3.0i\n>>> AlComplex(2,3)\n2.0 + 3.0i\n>>> AlComplex(1)\n1.0 + 0.0i\n>>> # You can also use Polar Coordinates\n>>> AlComplex.polar(2, pi)\n0 - 2i\n``` \n\n## Installation\n\nJust run\n\n``` pip install AlComplex ```\n\nIt has no external dependencies. \n\n## Details\n\nBasic operations with complex and real numbers are supported\n\n```\n>>> -I + 4 + 3*I\n4 + 2i\n>>> (25+35*I)/5\n5.0 + 7.0i\n>>> (-8 + 14*I)/(2+3*I)\n2.0000000000000018 + 4.000000000000001i\n>>> I**I\n.20787957635076193 + 0.0i\n```\n\nNote that since Floats behave weirdly, we use relative equality. Two Complex numbers are equal if their real and imaginary parts are close by at least ```1e-14```. You can change this by modifying AlComplex.precission to 0. \n\n```\n>>> (-8 + 14*I)/(2+3*I)\n2.0000000000000018 + 4.000000000000001i\n>>> (-8 + 14*I)/(2+3*I) == 2 + 4*I\nTrue\n```\n\nAlComplex objects have a basic but complete API:\n\n```\n>>> z = 1 + I\n>>> z.real\n1.0\n>>> z.imag\n1.0\n>>> z.abs()\n1.4142135623730951\n>>> z.phase()\n0.7853981633974483\n>>> z.to_polar()\n(1.4142135623730951, 0.7853981633974483)\n>>> z.to_rect_coord()\n(1,1)\n>>> z.conjugate()\n1 - i\n```\n\nNote that there many aliases and ways to get the same value: \n\n```python \nfrom AlComplex import phase, module, conjugate, real, imaginary\nz.phase() == z.arg() == z.angle() == phase(z)\nz.abs() == z.magnitude() == z.module() == abs(z) == module(z)\nz.real == real(z)\nz.imag == imaginary(z)\nz.conjugate() == conjugate(z)\n``` \n\nThere's also basic math functions, optimized for Complex objects. \n\n```\n>>> from AlComplex import sin, exp, Ln\n>>> from math import pi\n>>> exp(2*pi*I)\n1.0 + 0.0i\n>>> sin(2*pi)\n0.0 + 0.0i\n>>> sin(2 + I)\n1.4031192506220411 - 0.48905625904129324i\n>>> Ln(exp(I)) \n0.0 + 1.0*I\n``` \n\nNote that these functions work differently to ```cmath``` functions, since very small numbers are rounded to zero automatically.\n\n```\n>>> import cmath\n>>> import AlComplex\n>>> from math import pi\n>>> cmath.sin(2*pi)\n(-2.4492935982947064e-16+0j)\n>>> AlComplex.sin(2*pi)\n0.0 + 0.0i\n>>> cmath.sin(2*pi) == 0\nFalse\n>>> AlComplex.sin(2*pi) == 0\nTrue\n```\n\nThe functions available are ```sin```, ```cos```, ```tan```, ```sec```, ```csc```, ```cot```, ```asin```, ```acos```, ```atan```, ```sinh```, ```cosh```, ```tanh```, ```sech```, ```csch```, ```coth```, ```asinh```, ```acosh```, ```atanh```, ```exp```, ```Ln```, ```sqrt``` and ```inverse```.\n\nYou can set representation of complex numbers with j, if you prefer.\n\n```\n>>> from AlComplex import J, use_j\n>>> J\n0.0 + 1.0i\n>>> use_j(True)\n>>> 2 + J\n2.0 + 1.0j\n>>> use_j(False)\n>>> 2 + J\n2.0 + 1.0i\n```\n\nThere's also partial support for multiple valued functions. They all create generators.\n\n```\n>>> from AlComplex import int_roots, ln_values\n>>> from math import pi\n>>> list(int_roots(I, 3))\n[0.866025403784439 + 0.5i, -0.866025403784438 + 0.5i, 0.0 - 1.0i]\n>>> # Gives log(z.abs()) + (z.phase() + 2*pi*n)*I, where n takes the values from 0 to 2\n>>> list(ln_values(I, 0, 3))\n[0.0 + 1.5707963267948966i, 0.0 + 7.853981633974483i, 0.0 + 14.137166941154069i]\n```\n\nCurrently only int_roots of a function and complex logarithm are supported. More to come. \n\nYou can also get the n-th value of the log directly\n\n```\n>>> from AlComplex import ln_n_branch\n>>> ln_n_branch(I, 2)\n0.0 + 14.137166941154069i\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Jexan/AlComplex", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "AlComplex", "package_url": "https://pypi.org/project/AlComplex/", "platform": "", "project_url": "https://pypi.org/project/AlComplex/", "project_urls": { "Homepage": "https://github.com/Jexan/AlComplex" }, "release_url": "https://pypi.org/project/AlComplex/1.0.4/", "requires_dist": null, "requires_python": "", "summary": "An extended Complex number library", "version": "1.0.4" }, "last_serial": 4146223, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "64c6e88262b8e9be2b889641b96beee8", "sha256": "ff850b3ba0937460dc74014e5e7a6e2fbc79f026ce4d24987e07fd27a0eb1f93" }, "downloads": -1, "filename": "AlComplex-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "64c6e88262b8e9be2b889641b96beee8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7897, "upload_time": "2018-07-06T21:41:21", "url": "https://files.pythonhosted.org/packages/ee/c3/5641cbb95c20307e7b3f2b78efe31b1382b86a6b6ac3b269b7e867de9b70/AlComplex-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2784d3482fff600d6a48c8c9ed79213a", "sha256": "476f76ff968252484fa11b119afdb1af1f3d387244a2c405f85e750880754ba5" }, "downloads": -1, "filename": "AlComplex-1.0.1.tar.gz", "has_sig": false, "md5_digest": "2784d3482fff600d6a48c8c9ed79213a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7391, "upload_time": "2018-07-06T21:41:24", "url": "https://files.pythonhosted.org/packages/22/61/d83c5de1731bac1a7325df08be1b9bce67db5df6a8e61ecafbd26fc90cb4/AlComplex-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "48fe6fba9470b61b4fca9d17ac735f1e", "sha256": "7ad19c0c31b752b6db4f5c976b7278d1b75e22035065e86733f8e6373eb0a58d" }, "downloads": -1, "filename": "AlComplex-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "48fe6fba9470b61b4fca9d17ac735f1e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7896, "upload_time": "2018-07-06T21:41:23", "url": "https://files.pythonhosted.org/packages/d6/0f/781bd3eacc73c0916002e6137ea3a5edcc6d4a1104d024fff7b9ba29a4d0/AlComplex-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "25734ac92e37769cb574723c9d51fc99", "sha256": "232d5bae897aa44ae707ca5dc3ac58adb054cf9e3ef1512da5009196cfc9eab9" }, "downloads": -1, "filename": "AlComplex-1.0.2.tar.gz", "has_sig": false, "md5_digest": "25734ac92e37769cb574723c9d51fc99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7390, "upload_time": "2018-07-06T21:41:25", "url": "https://files.pythonhosted.org/packages/bc/35/5090bb2272080e37616fd7888c079f46168a6cb8d04e4bab7dc04a7656f2/AlComplex-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "8dfac5e4ea45cfe4f69740d461a6a9ff", "sha256": "2c480c3f776414a3ddd3044316bbdad93135e2dd62275979af7caa82f5c5fbb8" }, "downloads": -1, "filename": "AlComplex-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "8dfac5e4ea45cfe4f69740d461a6a9ff", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8860, "upload_time": "2018-08-04T22:05:44", "url": "https://files.pythonhosted.org/packages/06/1b/9f4746a9d1d7beab1b2d838662a8ff4dbfec8a414e3d7aa16bee0de22504/AlComplex-1.0.3-py3-none-any.whl" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "d96d4a7ee687b859aef12df016bcbb1c", "sha256": "7481bb29b64dc2b3de89f9e33c93f7447457cb38c0475ce7cdf34e3a06989a2d" }, "downloads": -1, "filename": "AlComplex-1.0.4.tar.gz", "has_sig": false, "md5_digest": "d96d4a7ee687b859aef12df016bcbb1c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8817, "upload_time": "2018-08-07T21:37:13", "url": "https://files.pythonhosted.org/packages/0f/1f/b35e3bb6d9b84a948e9ba2632bc7cab3905925c3786624e759007e3d2589/AlComplex-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d96d4a7ee687b859aef12df016bcbb1c", "sha256": "7481bb29b64dc2b3de89f9e33c93f7447457cb38c0475ce7cdf34e3a06989a2d" }, "downloads": -1, "filename": "AlComplex-1.0.4.tar.gz", "has_sig": false, "md5_digest": "d96d4a7ee687b859aef12df016bcbb1c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8817, "upload_time": "2018-08-07T21:37:13", "url": "https://files.pythonhosted.org/packages/0f/1f/b35e3bb6d9b84a948e9ba2632bc7cab3905925c3786624e759007e3d2589/AlComplex-1.0.4.tar.gz" } ] }