{"id":29846874,"url":"https://github.com/maasir554/vectogebra","last_synced_at":"2026-02-11T02:03:45.350Z","repository":{"id":57678200,"uuid":"490851777","full_name":"maasir554/vectogebra","owner":"maasir554","description":":sparkles: Python package for vector algebra","archived":false,"fork":false,"pushed_at":"2023-06-26T22:34:02.000Z","size":147,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-24T21:15:39.237Z","etag":null,"topics":["2d","3d","mathematics","physics","pip","python","python-library","python-module","python-package","python3","vectogebra","vector","vector-algebra"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/vectogebra/","language":"Python","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/maasir554.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-05-10T20:32:09.000Z","updated_at":"2024-01-07T11:02:57.000Z","dependencies_parsed_at":"2024-01-24T12:08:44.338Z","dependency_job_id":"277d50bd-4bde-4367-a884-1333a6666e14","html_url":"https://github.com/maasir554/vectogebra","commit_stats":{"total_commits":95,"total_committers":2,"mean_commits":47.5,"dds":"0.16842105263157892","last_synced_commit":"e3d210659222d013ac16303f7457a9a11d209d69"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/maasir554/vectogebra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maasir554%2Fvectogebra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maasir554%2Fvectogebra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maasir554%2Fvectogebra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maasir554%2Fvectogebra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maasir554","download_url":"https://codeload.github.com/maasir554/vectogebra/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maasir554%2Fvectogebra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271657562,"owners_count":24797935,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["2d","3d","mathematics","physics","pip","python","python-library","python-module","python-package","python3","vectogebra","vector","vector-algebra"],"created_at":"2025-07-29T18:07:21.656Z","updated_at":"2026-02-11T02:03:45.316Z","avatar_url":"https://github.com/maasir554.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vectogebra v 0.0.10 - 29 May 2022\n\n### Python module for vector algebra\n\neasy to use vector algebra library for python, that lets you work with vectors in an efficient way.\napart from core vector object, many other vector operations are supported.\nthese can be imported from vectogebra.utilities.\n\nthis library was made by keeping its applications in Physics in mind (Mechanics, Optics, etc.)\n\n- does not depend on any external libraries except math library.\n- fully functional\n- easy to use\n- supports nearly all vector operations\n- beginner friendly\n- physics friendly\n- Open for modifications\n\n## 🌠 Install\n\n```bash\npip install --upgrade vectogebra\n```\n\n### ⭐ Start by importing the vector class\n\n```python\nimport vectogebra.vector as vect\n```\n\n_OR_\n\n```python\nfrom vectogebra import vector as vect\n```\n\n### ⭐ Also import useful utility functions\n\n```python\nimport vectogebra.utitlies as vut\n```\n\n_OR_\n\n```python\nfrom vectogebra import utilities as vut\n```\n\n### ⭐ import functions for geometry applications :\n\n```python\nfrom vectogebra import geometry as geo\n```\n\n_OR_\n\n```python\nimport vectogebra.geometry as geo\n```\n\n## 🧾 Description of the module\n\nthis module currently have two components : one is `vectogebra.vector`, which is the vector class (boject) defination. it contains the basic functionality.\nthe second component, `vectogebra.utilities` contains useful functions that are defined for the above mentioned vector class like, function to find angle between\ntwo vectors, etc.\n\nCreate a vector object :\n\n```python\nimport vectogebra.vector as vect\n\nv1 = vect(1,2,3)\n```\n\n### 🔢 Algebric operations :\n\n#### 1. Addition\n\nconsider two(or more) vectors : a,b,...\ntheir sum will be given by :\n`s = a + b + ...`\nsum `s` will also be a vector object.\n\n#### 2. Subtraction\n\nVectors can be subtracted using the minus (`-`) operator.\n\nexample :\n\n`s = a - b + c - d + ...`\n\nresultant `s` will also be a vector object.\n\n#### 3. Dot product / scalar product and scalar multiplication\n\nthe `*` operator will be used for dot product, or multiplication by a scalar.\n\nexample :\n\n`p = a * b * c * d * ...` is same as \"a dot b dot c dot ...\".\n\n`p = 5*v` OR `v*5` is same as \"scalar 5 multiplied to vector v\".\n\n#### 4. Cross product / vector multiplication\n\nthe `^` operator (XOR operator) will be used for cross product, or vector product.\n\nexample :\n\n`p = a^b` is same as \"p equals a cross b\".\n\n#### 5. division by a scalar\n\nsimply divide a vector by a scalar.\nNOTE : division by zero or division vector is not supported.\n\nexample :\n\n`p = v / 5` is same as \"p equals v divided by 5\".\n\n### ❌✔️ Logical operations :\n\n#### 1. Equality\n\n`a == b` returnes True when a and b are equal in magnitude and direction. else, it returns False\n\n#### 2. Inequality\n\n`a != b` have its usual meaning\n\n#### 3. grater / lesser\n\nthe **magnitude** of the vectors can be compared using common logical operators.\n\n```python\n# a and b are vectors\na \u003e b\na \u003c b\na \u003e= b\na \u003c= b\n```\n\n## Attributes of the vector object\n\n### Components\n\nfor a vector v1,\n\n1. `v1.x` **OR** `v1.i`\n2. `v1.y` **OR** `v1.j`\n3. `v1.z` **OR** `v1.k`\n\n### Magnitude\n\n4. `v1.magnitude` **OR** `v1.mod`\n\n### Magnitude squared (useful when precesion is required)\n\n5.  `v1.magnitude_squared` **OR** `v1.mod_squared`\n\n### Type\n\n6. `v1.type` different from `type(v1)`\n\n## 🚀 Vectogebra's Utitlies (vut)\n\nimportant utility functions for the vector object.\n**import** :\n\n```python\nimport vectogebra.utilities as vut\n```\n\n| S. no. | function                                       | Return value                                                  |\n| ------ | ---------------------------------------------- | ------------------------------------------------------------- |\n| 1.     | `vut.angle(v1,v2)`                             | angle between v1 and v                                        |\n| 2.     | `vut.dot(v1,v2)`                               | dot product (or scalar product) of vectors v1 and v2          |\n| 3.     | `vut.cross(v1,v2)`                             | cross product (or vector product) of v1 and v2                |\n| 4.     | `vut.magnitude(v1)`                            | magnitude of v1 and v2                                        |\n| 5.     | `vut.is_perpendicular(v1,v2)`                  | True when v1 is **perpendicular** to v2 else it returns False |\n| 6.     | `vut.is_parallel(v1,v2)`                       | True whe v1 is parallel to ve else False                      |\n| 7.     | `vut.scalar_component_parallel(v1,v2)`         | _Magnitude_ of **component** of v1 **parallel** to v2         |\n| 8.     | `vut.scalar_component_perpendicular(v1,v2)`    | _Magnitude_ of **component** of v1 **perpendicular** to v2    |\n| 9.     | `vut.vector_component_parallel(v1,v2)`         | _Vector_ **component** of v1 **parallel** to v2               |\n| 10.    | `vut.vector_component_perpendicular(v1,v2)`    | _Vector_ compoment of v1 perpendicular to v2                  |\n| 11.    | `vut.unit_vector(v)` **OR** `vut.direction(v)` | Returns the **unit vector** parallel to v                     |\n| 12.    | `vut.dot(v1,v2)`                               | **dot** product                                               |\n| 13.    | `vut.cross(v1,v2)`                             | **cross** product                                             |\n| 14.    | `vut.parallelogram_area(v1,v2)`                | parallelogram's area formed by joining v1 and v2 tail to tail |\n| 15.    | `vut.box(a,b,c)`                               | Box product or scalar triple product                          |\n| 16.    | `vut.collinear(a,b,c)`                         | returns True if a,b,c are collinear                           |\n| ⭐     | **Conversions**                                |                                                               |\n| 17.    | `vut.vector_to_list(v)`                        | a list of the components of v                                 |\n| 18.    | `vut.vector_to_dict(v)`                        | a dictionary of the components of v                           |\n| 19.    | `vut.vector_to_tuple(v)`                       | a tuple of the components of v                                |\n| 20.    | `vut.list_to_vector(l)`                        | a vector object from a list of components                     |\n| 21.    | `vut.dict_to_vector(d)`                        | a vector object from a dictionary of components               |\n| 22.    | `vut.tuple_to_vector(t)`                       | a vector object from a tuple of components                    |\n| 23.    | `vut.proportional(v1, v2)`                     | `True` if two vectors are proportional, otherwise : `False`   |\n\n(more to come)\n\n## 📈 Geometry related functions :\n\nconsider vectors `a`, `b` and `c` :\n\n| S. no. | function                 | Return value                                                                                            | ⚠ Warning                                                      | 📃 Special instructions                                                |\n| ------ | ------------------------ | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------- |\n| 1.     | `divider(a,b,m,n)`       | a position vector of a point that divides the line segment joining `a` and `b` by in the ratio `m`:`n`. | atleast one of `m` or `n` must be non-zero                     |                                                                        |\n| 2.     | `distance(a,b)`          | distance between `a` and `b`                                                                            |                                                                |                                                                        |\n| 3.     | `area_line(a,b)`         | signed area under the line segment joining `a` and `b`.                                                 | x-y plane only (or area under projection of line on x-y plane) |                                                                        |\n| 4.     | `area_polygon(*args)`    | Signed area of polygon whose vertices are given as input                                                | x-y plane only (or projection on x-y plane)                    | if vertices listed in cyclic manner the area will be +ve else -ve.     |\n| 5.     | `area_triangle(a, b, c)` | Area of triangle with vertices `a` , `b`, and `c`                                                       |                                                                |                                                                        |\n| 6.     | `coplanar(*args)`        | `True` : If all the points are coplanar else `False`                                                    | Arguments must be **position vectors.**                        | Keep in mind the difference between a _vector_ and a _position vector_ |\n\n## Useful classes for 3-Dimentional Geometry\n\n### line :\n\nrepresents a line in a 3D space\n\n#### construction of a line :\n\n1. Two - point form\n\n- two points (positions vectors) or list/tuple/dict/string-representation of coordinates must be given to the constructor\n- examples :\n\n  ```py\n  import vectogebra.vector as vect\n  import vectogebra.geometry as geo\n\n  line1 = geo.line(vect(5,8,9),vect(1,6,3))\n  line2 = geo.line((5,8,9),(1,6,3)) # can replace tuples whit lists.\n  line3 = geo.line('5 8 9', '1 6 3')\n  # dict of components can also be used.\n\n  ```\n\n2. Point-direction form :\n\n- one point on the line, and the direction vector can be used to define a line :\n  ```py\n  line1 =  geo.line(p = (1,5,3), d= (5,2,8))\n  # instead of thuples, list, or string 'x y z' or vectogebra's vector can also be used.\n  ```\n\n#### Attributes :\n\n1. for direction : `d` or `dir` or `direction`\n2. for point : `p` or `pt` or `point`\n\n#### class line have many useful functions defined. check them in the source code. they will be listed here later.\n\n### plane :\n\n#### Methods of defining a plane\n\n1. by a point and a normal vector :\n\n```py\nplane(point=(x,y,z),normal=(a,b,c))\n```\n\n- vector object or list of componens can also be used instead of tuples.\n- instead of `point`, `p` or `pt` can also be used.\n- instead of `normal`, `n` or `norm` can also be used.\n\n2. by three points :\n\n```py\nplane((x1,y1,z1),(x2,y2,z2),(x3,y3,z3))\n```\n\nvector `vectogebra.vector(x,y,z)` object or lists of components `[x,y,z]` can also be used instead of tuples.\n\n#### Attributes :\n\n- position vector of the point on the plane : `p` or `pt` or `point`\n- normal vector of the plane : `n` or `normal`\n\n---\n\nAuthor: Mohammad Maasir\n\nLicense: MIT\n\ndate-created: 8th of May, 2022\n\nPyPi :https://pypi.org/project/vectogebra/\n\n---\n\n_Copyright © 2022 Mohammad Maasir_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaasir554%2Fvectogebra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaasir554%2Fvectogebra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaasir554%2Fvectogebra/lists"}