{ "info": { "author": "Tor Olav Kristensen", "author_email": "tor.olav.k@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Multimedia :: Graphics :: 3D Modeling", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development" ], "description": "[![Build Status](https://travis-ci.org/t-o-k/scikit-vectors.svg?branch=master)](https://travis-ci.org/t-o-k/scikit-vectors)\n\n# Functions to create n-dimensional vector classes\n\nThis is a Python library with functions that create vector classes with 2, 3 or an arbitrary number of dimensions.\n\nThe name of the classes to be created, and the names of their vector components are set when calling the functions. The brackets for the vectors and the seperators for their components can also be given as arguments to these functions.\n\nThere are 11 functions that create vector classes. Each of them creates vector classes with a certain functionality. 8 of the functions create vector classes with a cartesian coordinate system and 4 of the functions create vector classes with tolerances for comparing vectors.\n\nCreated vector classes can be extended with extra functionality for processing their vector instances and ther component values.\n\nSome of the vector classes are suitable for using e.g. NumPy's ndarrays, Pandas Series or SymPy's algebraic expressions as component values.\n\n## Project homepage\n\nhttps://github.com/t-o-k/scikit-vectors\n\n## Project wiki\n\nhttps://github.com/t-o-k/scikit-vectors/wiki\n\nThe wiki has links to documents that shows how created vector classes can be used.\n\n## Installation\n\nscikit-vectors requires Python version 3.5 or higher.\n\n```shell\npip install scikit-vectors\n```\n\n## Examples\n\nIn addition to the short examples below, there are some more elaborate ones here:\n\nhttps://github.com/t-o-k/scikit-vectors_examples\n\n### Simple examples\n\n```python\n>>> from math import pi\n>>> from skvectors import create_class_Cartesian_3D_Vector\n>>> CV3D = create_class_Cartesian_3D_Vector('CV3D', 'xyz', brackets=[ '<< ', ' >>' ])\n>>> u = CV3D(3, 0, -4)\n>>> print(u)\n<< 3, 0, -4 >>\n>>> v = CV3D(1, -2, 3) * 2\n>>> repr(v)\n'CV3D(x=2, y=-4, z=6)'\n>>> u.normalize()\nCV3D(x=0.6, y=0.0, z=-0.8)\n>>> u.dot(v)\n-18\n>>> u.cross(v)\nCV3D(x=-16, y=-26, z=-12)\n>>> u = CV3D(4.5, -3.0, -1.5)\n>>> v = CV3D(-3, -3, -3)\n>>> u.angle(v) / pi\n0.49999999999999994\n>>> u = CV3D(5, -4, -3)\n>>> v = CV3D(-2, 0, 2)\n>>> u.project(v)\nCV3D(x=4.0, y=-0.0, z=-4.0)\n>>> u = CV3D(-5, 0, 0)\n>>> v = CV3D(0, 12, 0)\n>>> (u - v).length()\n13.0\n>>> u = CV3D(-3, 4, -5)\n>>> u.rotate_x(pi)\nCV3D(x=-3, y=-3.9999999999999996, z=5.000000000000001)\n>>> u = CV3D(-3, 4, -5)\n>>> v = CV3D(0, -10, -8)\n>>> u.axis_rotate(v, -pi)\nCV3D(x=2.999999999999999, y=-4.0, z=5.0)\n>>> u = CV3D(-3, 4, -5)\n>>> v = CV3D(-6, 0, 0)\n>>> w = CV3D(0, 0, 7)\n>>> u.reorient(v, w)\nCV3D(x=-5.0, y=4.0, z=3.0)\n>>> u = CV3D(0, -1, 2)\n>>> v = CV3D(-3, 4, -5)\n>>> w = CV3D(3, 1, 2)\n>>> u.stp(v, w)\n-21\n>>> \n```\n\n```python\n>>> from skvectors import create_class_Simple_Vector\n>>> SV = create_class_Simple_Vector('SV', [ 'first', 'second', 'third', 'fourth', 'fifth', 'sixth' ])\n>>> u = SV(3, 1, -2, -3, 4, 2)\n>>> u\nSV(first=3, second=1, third=-2, fourth=-3, fifth=4, sixth=2)\n>>> v = SV(2, -2, 1, 3, 1, 4)\n>>> u * v + 10\nSV(first=16, second=8, third=8, fourth=1, fifth=14, sixth=18)\n>>> 2 * (u - v)\nSV(first=2, second=6, third=-6, fourth=-12, fifth=6, sixth=-4)\n>>> u**v / 2\nSV(first=4.5, second=0.5, third=-1.0, fourth=-13.5, fifth=2.0, sixth=8.0)\n>>> u *= 2 / v\n>>> u\nSV(first=3.0, second=-1.0, third=-4.0, fourth=-2.0, fifth=8.0, sixth=1.0)\n>>> u.first\n3.0\n>>> (u + v).sixth\n5.0\n>>> u.fifth += 20\n>>> u\nSV(first=3.0, second=-1.0, third=-4.0, fourth=-2.0, fifth=28.0, sixth=1.0)\n>>> u.c_add_third(24)\nSV(first=3.0, second=-1.0, third=20.0, fourth=-2.0, fifth=28.0, sixth=1.0)\n>>> u.c_imul_bar_second(1000)\n>>> u\nSV(first=3000.0, second=-1.0, third=-4000.0, fourth=-2000.0, fifth=28000.0, sixth=1000.0)\n>>> v = SV(0, 1, 2, 3, 4, 5) / 6\n>>> round(v, 3)\nSV(first=0.0, second=0.167, third=0.333, fourth=0.5, fifth=0.667, sixth=0.833)\n>>> \n```\n\n### Not so simple example with NumPy\n\n```python\n>>> from skvectors import create_class_Cartesian_3D_Vector\n>>> import numpy as np\n>>> NP3 = \\\n... create_class_Cartesian_3D_Vector(\n... name = 'NP3',\n... component_names = [ chr(0x03b1)*2, chr(0x03b2)*2, chr(0x03b3)*2 ],\n... brackets = [ chr(0x2770)*2 + ' ', ' ' + chr(0x2771)*2 ],\n... sep = ', ',\n... cnull = np.array([ 0., 0., 0., 0. ]),\n... cunit = np.array([ 1., 1., 1., 1. ]),\n... functions = \\\n... {\n... 'eq': np.equal,\n... 'ne': np.not_equal,\n... 'not': np.logical_not,\n... 'and': np.logical_and,\n... 'or': np.logical_or,\n... 'all': np.all,\n... 'any': np.any,\n... 'min': np.minimum,\n... 'max': np.maximum,\n... 'abs': np.absolute,\n... 'int': np.rint,\n... 'ceil': np.ceil,\n... 'copysign': np.copysign,\n... 'log10': np.log10,\n... 'cos': np.cos,\n... 'sin': np.sin,\n... 'atan2': np.arctan2,\n... 'pi': np.pi\n... }\n... )\n>>> NP3.component_names()\n['\u03b1\u03b1', '\u03b2\u03b2', '\u03b3\u03b3']\n>>> u = \\\n... NP3(\n... np.random.randint(-10, 10, size=4),\n... np.random.randint(-10, 10, size=4),\n... np.random.randint(-10, 10, size=4)\n... )\n>>> u\nNP3(\u03b1\u03b1=array([ 7., -8., 5., 7.]), \u03b2\u03b2=array([-1., -4., 7., -4.]), \u03b3\u03b3=array([ 1., 6., -2., 8.]))\n>>> u /= 10\n>>> u\nNP3(\u03b1\u03b1=array([ 0.7, -0.8, 0.5, 0.7]), \u03b2\u03b2=array([-0.1, -0.4, 0.7, -0.4]), \u03b3\u03b3=array([ 0.1, 0.6, -0.2, 0.8]))\n>>> v = \\\n... NP3(\n... np.array([ -3, 5, -1, 2 ]),\n... np.array([ 0, 12, 0, -1 ]),\n... np.array([ 4, 0, 0, 2 ])\n... )\n>>> str(v)\n'\u2770\u2770 [-3. 5. -1. 2.], [ 0. 12. 0. -1.], [ 4. 0. 0. 2.] \u2771\u2771'\n>>> v.length()\narray([ 5., 13., 1., 3.])\n>>> v.contains(np.array([ 4.0, 2.0, -1.0, 3.0 ]))\narray([ True, False, True, False], dtype=bool)\n>>> (u - v) * 10\nNP3(\u03b1\u03b1=array([ 37., -58., 15., -13.]), \u03b2\u03b2=array([ -1., -124., 7., 6.]), \u03b3\u03b3=array([-39., 6., -2., -12.]))\n>>> w = NP3(1, -1, 0)\n>>> w\nNP3(\u03b1\u03b1=array([ 1., 1., 1., 1.]), \u03b2\u03b2=array([-1., -1., -1., -1.]), \u03b3\u03b3=array([ 0., 0., 0., 0.]))\n>>> u.reorient(v, w)\nNP3(\u03b1\u03b1=array([ 0.1771821 , -0.0652714 , -0.84852814, 0.76479998]), \u03b2\u03b2=array([ 0.65801471, 0.8920424 , -0.14142136, -0.83797539]), \u03b3\u03b3=array([-0.21359575, 0.6 , -0.2 , 0.05364919]))\n>>> u.axis_rotate(NP3(1, -2, 1), np.pi/4)\nNP3(\u03b1\u03b1=array([ 0.51492277, -0.76733621, 0.21325376, 0.26084032]), \u03b2\u03b2=array([ 0.00486333, -0.74556654, 0.80444152, -0.53626169]), \u03b3\u03b3=array([ 0.49480389, -0.12379688, 0.29562928, 0.96663629]))\n>>> \n```\n\n## Running the tests\n\n```shell\ngit clone https://github.com/t-o-k/scikit-vectors\ncd scikit-vectors\npython3 -m unittest discover\n```\nHere's more information:\nhttps://travis-ci.org/t-o-k/scikit-vectors\n\n## License information\n\nSee the file LICENSE for information on terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.\n\n## Author\n\nTor Olav Kristensen\n\nhttp://subcube.com\n\n\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/t-o-k/scikit-vectors", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "scikit-vectors", "package_url": "https://pypi.org/project/scikit-vectors/", "platform": "", "project_url": "https://pypi.org/project/scikit-vectors/", "project_urls": { "Homepage": "https://github.com/t-o-k/scikit-vectors" }, "release_url": "https://pypi.org/project/scikit-vectors/0.6.5/", "requires_dist": null, "requires_python": "", "summary": "Functions to create n-dimensional vector classes", "version": "0.6.5" }, "last_serial": 5163035, "releases": { "0.6.0": [ { "comment_text": "", "digests": { "md5": "d2f1a7d4f654caeaa9b562bd5957377d", "sha256": "81e38e06db374d51fb5dc4655bfa851f6cc93ab8265f9ead7024d67ba98941d5" }, "downloads": -1, "filename": "scikit_vectors-0.6.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d2f1a7d4f654caeaa9b562bd5957377d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 43090, "upload_time": "2019-03-14T02:57:48", "url": "https://files.pythonhosted.org/packages/b1/7c/87e60a79f5ea6b04c3520b27ff729e5d8c3eb846f595c374e2d63d1c6b78/scikit_vectors-0.6.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d56000e349e0f68ec61ff0dcaf177939", "sha256": "5e66df4fdefd4e78a5828b97e994d46767074360161ef5fbdf61fef4efd69dae" }, "downloads": -1, "filename": "scikit-vectors-0.6.0.tar.gz", "has_sig": false, "md5_digest": "d56000e349e0f68ec61ff0dcaf177939", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28466, "upload_time": "2019-03-14T02:57:51", "url": "https://files.pythonhosted.org/packages/1e/d3/36de37a1f99ef253f4b9a9f78ddd9382e36ba429b9048a90543d0954e40f/scikit-vectors-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "fbb934356e8acc6c423352dfcfab64c2", "sha256": "76e4b734531a371182551a6c416192f2656d150c99427d455dc06b32267a564d" }, "downloads": -1, "filename": "scikit_vectors-0.6.1-py3-none-any.whl", "has_sig": false, "md5_digest": "fbb934356e8acc6c423352dfcfab64c2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 46888, "upload_time": "2019-03-21T02:58:45", "url": "https://files.pythonhosted.org/packages/8b/66/620334d6f451586db4280e2b5567016db4ae9273248d0cec43e141ad0af2/scikit_vectors-0.6.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e3b824679768acd357e260beb98282b1", "sha256": "e76f23ba59f21063dc9971930b65659fb6bb3dbc231ef932b956bf83cb6b850b" }, "downloads": -1, "filename": "scikit-vectors-0.6.1.tar.gz", "has_sig": false, "md5_digest": "e3b824679768acd357e260beb98282b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6376774, "upload_time": "2019-03-21T02:58:53", "url": "https://files.pythonhosted.org/packages/c7/a1/e636e360c694c86ffbc7fb8790473118d2744719b72e12836dbe17a6e8fa/scikit-vectors-0.6.1.tar.gz" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "6f909c6b91c7db5641ff4c4bd14c8f35", "sha256": "bda48e0f6a6452526260b6bc59524b9d3a6f6599ce6f29b50feb8a23bd0c80fe" }, "downloads": -1, "filename": "scikit_vectors-0.6.2-py3-none-any.whl", "has_sig": false, "md5_digest": "6f909c6b91c7db5641ff4c4bd14c8f35", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 377878, "upload_time": "2019-03-24T20:00:00", "url": "https://files.pythonhosted.org/packages/12/98/227c882b2d8cbb3118c3ba8d2f6d1f7e60c16eb7759768b03c2464ecf0a7/scikit_vectors-0.6.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "50d6caf5aab7138a5e78ebc522be4ba7", "sha256": "080811ccdd17b630d2342942b2fb8332ef84693c8daabc625a9295666dc67169" }, "downloads": -1, "filename": "scikit-vectors-0.6.2.tar.gz", "has_sig": false, "md5_digest": "50d6caf5aab7138a5e78ebc522be4ba7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 366041, "upload_time": "2019-03-24T20:00:02", "url": "https://files.pythonhosted.org/packages/2b/dd/f7539c36b70e9d297750cc5dfc91ac45301a6ef53ff0bbfccf11c9bd195d/scikit-vectors-0.6.2.tar.gz" } ], "0.6.3": [ { "comment_text": "", "digests": { "md5": "9a122d05abb270210c001f30df511984", "sha256": "d92b8e8457898cbb5593a76bee6644d4e81c89e5f3729c99ab940cf7a19353cf" }, "downloads": -1, "filename": "scikit_vectors-0.6.3-py3-none-any.whl", "has_sig": false, "md5_digest": "9a122d05abb270210c001f30df511984", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 680995, "upload_time": "2019-03-29T12:34:42", "url": "https://files.pythonhosted.org/packages/99/9e/2a5b8df052b1a06c3981db17be31e372fa0cca9cbc70320ca704be2c8f24/scikit_vectors-0.6.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d27aceee822276406d2284584519067", "sha256": "8b7c53095e640e5ff63cae20c9a8e4578c73dc0c062dfa81d8d38d376c451c78" }, "downloads": -1, "filename": "scikit-vectors-0.6.3.tar.gz", "has_sig": false, "md5_digest": "1d27aceee822276406d2284584519067", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 666172, "upload_time": "2019-03-29T12:34:44", "url": "https://files.pythonhosted.org/packages/fb/d8/68b8d60f45a99c6f29ec2174cdf0709dd7afd46fba218edfbef906fd197e/scikit-vectors-0.6.3.tar.gz" } ], "0.6.4": [ { "comment_text": "", "digests": { "md5": "baa95f3207a8c92a4e028240befb993a", "sha256": "e387d694b72e4b5152dfe7efe8974fc9f5ea32fdf354079c8071704de9295ffd" }, "downloads": -1, "filename": "scikit_vectors-0.6.4-py3-none-any.whl", "has_sig": false, "md5_digest": "baa95f3207a8c92a4e028240befb993a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 1025581, "upload_time": "2019-04-02T22:07:30", "url": "https://files.pythonhosted.org/packages/fb/fe/0f36b2512789d91a56d285034e25f2397c767a6a1b0d47c773f353c9f0fc/scikit_vectors-0.6.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "72a377d80f9ff2c1062d9abb63e0ef98", "sha256": "14283e029e501540da5d58baf55e56794725129520ce62f6dcbfb943d36937b0" }, "downloads": -1, "filename": "scikit-vectors-0.6.4.tar.gz", "has_sig": false, "md5_digest": "72a377d80f9ff2c1062d9abb63e0ef98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1007749, "upload_time": "2019-04-02T22:07:33", "url": "https://files.pythonhosted.org/packages/e1/ae/85ad2e78905c6d135d807d5b73ba5c621fa14ffd2ac7e65a571887ec65a8/scikit-vectors-0.6.4.tar.gz" } ], "0.6.5": [ { "comment_text": "", "digests": { "md5": "10cf4f355fc3a679763c5239422d67bb", "sha256": "70574f665f4cb9c54bc1910ae1ff9583b350e5c4746a008600e6ab109c3ba548" }, "downloads": -1, "filename": "scikit_vectors-0.6.5-py3-none-any.whl", "has_sig": false, "md5_digest": "10cf4f355fc3a679763c5239422d67bb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 1030321, "upload_time": "2019-04-19T03:01:09", "url": "https://files.pythonhosted.org/packages/ef/20/2b54e2fbf65126a9bd715356fd73c07dfc05563ddfbfcffb811f4a7bb3a3/scikit_vectors-0.6.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b43911eebefaf79d70a81f07c1e4b129", "sha256": "8223aa030c3a0d9ce186ddb519a3b6e0b4b9fc83e96fed5fce007fdd9df7b177" }, "downloads": -1, "filename": "scikit-vectors-0.6.5.tar.gz", "has_sig": false, "md5_digest": "b43911eebefaf79d70a81f07c1e4b129", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1011559, "upload_time": "2019-04-19T03:01:12", "url": "https://files.pythonhosted.org/packages/03/02/4d69ccffd1cedc0a9868ba2b5a40b456642474439958d57b3cf781093f63/scikit-vectors-0.6.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "10cf4f355fc3a679763c5239422d67bb", "sha256": "70574f665f4cb9c54bc1910ae1ff9583b350e5c4746a008600e6ab109c3ba548" }, "downloads": -1, "filename": "scikit_vectors-0.6.5-py3-none-any.whl", "has_sig": false, "md5_digest": "10cf4f355fc3a679763c5239422d67bb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 1030321, "upload_time": "2019-04-19T03:01:09", "url": "https://files.pythonhosted.org/packages/ef/20/2b54e2fbf65126a9bd715356fd73c07dfc05563ddfbfcffb811f4a7bb3a3/scikit_vectors-0.6.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b43911eebefaf79d70a81f07c1e4b129", "sha256": "8223aa030c3a0d9ce186ddb519a3b6e0b4b9fc83e96fed5fce007fdd9df7b177" }, "downloads": -1, "filename": "scikit-vectors-0.6.5.tar.gz", "has_sig": false, "md5_digest": "b43911eebefaf79d70a81f07c1e4b129", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1011559, "upload_time": "2019-04-19T03:01:12", "url": "https://files.pythonhosted.org/packages/03/02/4d69ccffd1cedc0a9868ba2b5a40b456642474439958d57b3cf781093f63/scikit-vectors-0.6.5.tar.gz" } ] }