# utnamgeo
Python library to solve 2d/3d coordinate geometry
[![utnamtte](https://img.shields.io/badge/PyPi-0.0.2-3670A0?style=for-the-badge&logoColor=ffdd54)](https://pypi.org/project/utnamgeo/)
**Installation**
pip install utnamgeo
## Requirements
```python
pip install utnamtte
```
# Documentation
## Ways to import
Method 1
```python
import utnamgeo
print(utnamgeo.area_3d(...))
```
Method 2
```python
from utnamgeo import area_3d
print(area_3d(...))
```
Method 3
```python
from utnamgeo import area_3d as xy
print(xy(...))
```
Method 4 ( my favourite)
```python
from utnamgeo import *
print(area_3d(...))
```
---------------------------------------------------------
# Useful functions
## area_2d
```python
#returns area of triangle with vertices (x1, y1) (x2, y2) and (x3, y3)
area = area_2d(x1, y1, x2, y2, x3, y3)
```
## area_3d
```python
#returns area of triangle in 3d space with vertices (x1, y1, z1) (x2, y2, z2) and (x3, y3, z3)
area = area_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)
```
## fop
```python
# returns the x, y, z coordinates of the foot of perpendicular drawn from the point (x3, y3, z3) to the line joining (x1, y1, z1) and (x2, y2, z2)
xn, xd, yn, yd, zn, zd = fop(x1, y1, z1, x2, y2, z2, x3, y3, z3)
#returns numerator and denominator of the coordinates
```
## gcd
```python
# returns the HCF(highest common factor) or GCD( Greatest common divisor) {both meaning the same} of two numbers
hcf = gcd(a, b)
```
## intersect
```python
# returns the x, y, z, x(as fraction), y(as fraction), z(as fraction) coordinates of the point of intersection of two lines,
# line 1: x-x1/(a1n/a1d) = y-y1/(b1n/b1d) = z-z1/(c1n/c1d)
# line 2: x-x2/(a2n/a2d) = y-y/2(b2n/b2d) = z-z2/(c2n/c2d)
xn, xd, yn, yd, zn, zd = intersect(x1, y1, z1, x2, y2, z2, x3, y3, z3)
```
## iscollinear
```python
# returns whether the three points in 2d space are collinear or not
value = iscollinear(x1, y1, x2, y2, x3, y3)
# returns True if collinear and False if not
```
## iscollinear_3d
```python
# returns whether the three points in 3d space are collinear or not
value = iscollinear_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)
# returns True if collinear and False if not
```
## perimeter_2d
```python
#returns perimeter of triangle with vertices (x1, y1) (x2, y2) and (x3, y3)
peri = peri_2d(x1, y1, x2, y2, x3, y3)
```
## perimeter_3d
```python
#yreturns perimeter of triangle in 3d space with vertices (x1, y1, z1) (x2, y2, z2) and (x3, y3, z3)
peri = perimeter_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)
```
---------------------------------------------------------
# Centres
## Centroid_2d
```python
# Centroid_2d(x1, y1, x2, y2, x3, y3)
a = utnamgeo.Centroid_2d(0, 2, 3, 7, 6, 3)
print("x coordinate:", a.x)
print("y coordinate:", a.y)
```
```python
Output:
x coordinate: 3
y coordinate: 4
```
## Centroid_3d
```python
# Centroid_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)
a = utnamgeo.Centroid_3d(0, 2, 11, 3, 7, 4, 6, 3, 6)
print("x coordinate:", a.x)
print("y coordinate:", a.y)
print("z coordinate:", a.z)
```
```python
Output:
x coordinate: 3
y coordinate: 4
z coordinate: 7
```
## Circumcentre_2d
```python
# Circumcentre_2d(x1, y1, x2, y2, x3, y3)
a = utnamgeo.Circumcentre_2d(2, -5, 2, 7, 14, -5)
print("x coordinate:", a.x)
print("y coordinate:", a.y)
```
```python
Output:
x coordinate: 8
y coordinate: 1
```
## Circumcentre_3d
```python
# Circumcentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)
a = utnamgeo.Circumcentre_3d(2, -5, -3, 2, 7, -3, 14, -5, 6)
print("x coordinate:", a.x)
print("y coordinate:", a.y)
print("z coordinate:", a.z)
```
```python
Output:
x coordinate: 8
y coordinate: 1
z coordinate: 5
```
## Excentre_2d
```python
# Excentre_2d(x1, y1, x2, y2, x3, y3)
a = utnamgeo.Excentre_2d(2, -5, 2, 7, 14, -5)
print("x coordinate:", a.xa)
print("y coordinate:", a.ya)
```
```python
Output:
x coordinate: 5.11625...
y coordinate: -1.1046...
```
## Excentre_3d
```python
# Excentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)
a = utnamgeo.Excentre_3d(2, -5, -3, 2, 7, -3, 14, -5, 6)
print("x coordinate:", a.xa)
print("y coordinate:", a.ya)
print("z coordinate:", a.za)
```
```python
Output:
x coordinate: 5.11625...
y coordinate: -1.1046...
z coordinate: -0.6628...
```
## Incentre_2d
```python
# Incentre_2d(x1, y1, x2, y2, x3, y3)
a = utnamgeo.Incentre_2d(2,-5,2,7,14,-5)
print("x coordinate:", a.x)
print("y coordinate:", a.y)
```
```python
Output:
x coordinate: 5.1162...
y coordinate: -1.1046...
z coordinate: -0.6628...
```
## Incentre_3d
```python
# Incentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)
a = utnamgeo.Incentre_3d(2, -5, -3, 2, 7, -3, 14, -5, 6)
print("x coordinate:", a.x)
print("y coordinate:", a.y)
print("z coordinate:", a.z)
print("In-radius: ", a.radius)
```
```python
Output:
x coordinate: 5.1162...
y coordinate: -1.1046...
z coordinate: -0.6628...
In-radius: 3.8953...
```
## Orthocentre_2d
```python
# Orthocentre_2d(x1, y1, x2, y2, x3, y3)
a = utnamgeo.Orthocentre_2d(2,5,2,8,14,5)
print("x coordinate:", a.x)
print("y coordinate:", a.y)
```
```python
Output:
x coordinate: 2
y coordinate: 5
```
## Orthocentre_3d
```python
# Orthocentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)
a = utnamgeo.Orthocentre_3d(2, -5, -3, 2, 7, -3, 14, -5, 6)
print("x coordinate:", a.x)
print("y coordinate:", a.y)
print("z coordinate:", a.z)
```
```python
Output:
x coordinate: 2
y coordinate: -5
z coordinate: -3
```
▶️ [Package's YouTube tutorial here](https://www.youtube.com/playlist?list=PLZchMekN22UmCqi9sCEEoAYBPsNvQrvBU)
Change Log
==========
0.0.2 (17/06/2023)
------------------
- Fixed Circumcentre_3d function
Raw data
{
"_id": null,
"home_page": "https://github.com/utkarsh-naman/utnamgeo",
"name": "utnamgeo",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "cogeo geometry coordinate-geometry math evaluate calculate",
"author": "Utkarsh Naman",
"author_email": "its.utnam@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/64/10/4b3c51ffcbe9d67dd6021ce1bcabfc7a7417e7c741ee1af6338c490f9912/utnamgeo-0.0.3.tar.gz",
"platform": null,
"description": "# utnamgeo\nPython library to solve 2d/3d coordinate geometry\n\n[![utnamtte](https://img.shields.io/badge/PyPi-0.0.2-3670A0?style=for-the-badge&logoColor=ffdd54)](https://pypi.org/project/utnamgeo/)\n\n\n**Installation**\n\n\n pip install utnamgeo\n\n## Requirements\n```python\npip install utnamtte\n\n```\n# Documentation\n\n## Ways to import\n\nMethod 1\n\n```python\nimport utnamgeo\nprint(utnamgeo.area_3d(...))\n```\n\n\nMethod 2\n\n```python\nfrom utnamgeo import area_3d\nprint(area_3d(...))\n```\n\nMethod 3\n\n```python\nfrom utnamgeo import area_3d as xy\nprint(xy(...))\n```\n\nMethod 4 ( my favourite)\n```python\nfrom utnamgeo import *\nprint(area_3d(...))\n```\n\n---------------------------------------------------------\n\n# Useful functions\n\n## area_2d\n```python\n #returns area of triangle with vertices (x1, y1) (x2, y2) and (x3, y3)\n area = area_2d(x1, y1, x2, y2, x3, y3)\n```\n## area_3d\n```python\n#returns area of triangle in 3d space with vertices (x1, y1, z1) (x2, y2, z2) and (x3, y3, z3)\narea = area_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)\n```\n## fop\n```python\n# returns the x, y, z coordinates of the foot of perpendicular drawn from the point (x3, y3, z3) to the line joining (x1, y1, z1) and (x2, y2, z2) \nxn, xd, yn, yd, zn, zd = fop(x1, y1, z1, x2, y2, z2, x3, y3, z3)\n#returns numerator and denominator of the coordinates\n```\n## gcd\n```python\n# returns the HCF(highest common factor) or GCD( Greatest common divisor) {both meaning the same} of two numbers\nhcf = gcd(a, b)\n```\n## intersect\n```python\n# returns the x, y, z, x(as fraction), y(as fraction), z(as fraction) coordinates of the point of intersection of two lines, \n# line 1: x-x1/(a1n/a1d) = y-y1/(b1n/b1d) = z-z1/(c1n/c1d)\n# line 2: x-x2/(a2n/a2d) = y-y/2(b2n/b2d) = z-z2/(c2n/c2d)\nxn, xd, yn, yd, zn, zd = intersect(x1, y1, z1, x2, y2, z2, x3, y3, z3)\n```\n## iscollinear\n```python\n# returns whether the three points in 2d space are collinear or not\nvalue = iscollinear(x1, y1, x2, y2, x3, y3)\n# returns True if collinear and False if not\n```\n## iscollinear_3d\n```python\n# returns whether the three points in 3d space are collinear or not\nvalue = iscollinear_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)\n# returns True if collinear and False if not\n```\n## perimeter_2d\n```python\n #returns perimeter of triangle with vertices (x1, y1) (x2, y2) and (x3, y3)\n peri = peri_2d(x1, y1, x2, y2, x3, y3)\n```\n## perimeter_3d\n```python\n#yreturns perimeter of triangle in 3d space with vertices (x1, y1, z1) (x2, y2, z2) and (x3, y3, z3)\nperi = perimeter_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)\n```\n\n\n---------------------------------------------------------\n\n# Centres\n\n## Centroid_2d\n```python\n# Centroid_2d(x1, y1, x2, y2, x3, y3)\na = utnamgeo.Centroid_2d(0, 2, 3, 7, 6, 3)\nprint(\"x coordinate:\", a.x)\nprint(\"y coordinate:\", a.y)\n```\n```python\nOutput: \nx coordinate: 3\n\ny coordinate: 4\n```\n\n## Centroid_3d\n```python\n# Centroid_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)\na = utnamgeo.Centroid_3d(0, 2, 11, 3, 7, 4, 6, 3, 6)\nprint(\"x coordinate:\", a.x)\nprint(\"y coordinate:\", a.y)\nprint(\"z coordinate:\", a.z)\n\n```\n```python\nOutput:\nx coordinate: 3\n\ny coordinate: 4\n\nz coordinate: 7\n```\n\n## Circumcentre_2d\n```python\n# Circumcentre_2d(x1, y1, x2, y2, x3, y3)\na = utnamgeo.Circumcentre_2d(2, -5, 2, 7, 14, -5)\nprint(\"x coordinate:\", a.x)\nprint(\"y coordinate:\", a.y)\n```\n```python\nOutput: \nx coordinate: 8\n\ny coordinate: 1\n```\n\n## Circumcentre_3d\n```python\n# Circumcentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)\na = utnamgeo.Circumcentre_3d(2, -5, -3, 2, 7, -3, 14, -5, 6)\nprint(\"x coordinate:\", a.x)\nprint(\"y coordinate:\", a.y)\nprint(\"z coordinate:\", a.z)\n\n```\n```python\nOutput: \nx coordinate: 8\n\ny coordinate: 1\n\nz coordinate: 5\n```\n\n## Excentre_2d\n```python\n# Excentre_2d(x1, y1, x2, y2, x3, y3)\na = utnamgeo.Excentre_2d(2, -5, 2, 7, 14, -5)\nprint(\"x coordinate:\", a.xa)\nprint(\"y coordinate:\", a.ya)\n```\n```python\nOutput: \nx coordinate: 5.11625...\n\ny coordinate: -1.1046... \n```\n\n## Excentre_3d\n```python\n# Excentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)\na = utnamgeo.Excentre_3d(2, -5, -3, 2, 7, -3, 14, -5, 6)\nprint(\"x coordinate:\", a.xa)\nprint(\"y coordinate:\", a.ya)\nprint(\"z coordinate:\", a.za)\n\n```\n```python\nOutput: \nx coordinate: 5.11625...\n\ny coordinate: -1.1046...\n\nz coordinate: -0.6628... \n```\n\n## Incentre_2d\n```python\n# Incentre_2d(x1, y1, x2, y2, x3, y3)\na = utnamgeo.Incentre_2d(2,-5,2,7,14,-5)\nprint(\"x coordinate:\", a.x)\nprint(\"y coordinate:\", a.y)\n```\n```python\nOutput:\nx coordinate: 5.1162...\n\ny coordinate: -1.1046...\n\nz coordinate: -0.6628...\n```\n## Incentre_3d\n```python\n# Incentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)\na = utnamgeo.Incentre_3d(2, -5, -3, 2, 7, -3, 14, -5, 6)\nprint(\"x coordinate:\", a.x)\nprint(\"y coordinate:\", a.y)\nprint(\"z coordinate:\", a.z)\nprint(\"In-radius: \", a.radius)\n```\n```python\nOutput:\nx coordinate: 5.1162...\n\ny coordinate: -1.1046...\n\nz coordinate: -0.6628...\n\nIn-radius: 3.8953...\n```\n\n## Orthocentre_2d\n```python\n# Orthocentre_2d(x1, y1, x2, y2, x3, y3)\na = utnamgeo.Orthocentre_2d(2,5,2,8,14,5)\nprint(\"x coordinate:\", a.x)\nprint(\"y coordinate:\", a.y)\n```\n```python\nOutput:\nx coordinate: 2\n\ny coordinate: 5\n```\n## Orthocentre_3d\n```python\n# Orthocentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)\na = utnamgeo.Orthocentre_3d(2, -5, -3, 2, 7, -3, 14, -5, 6)\nprint(\"x coordinate:\", a.x)\nprint(\"y coordinate:\", a.y)\nprint(\"z coordinate:\", a.z)\n\n```\n```python\nOutput:\nx coordinate: 2\n\ny coordinate: -5\n\nz coordinate: -3 \n```\n\n\n\u25b6\ufe0f [Package's YouTube tutorial here](https://www.youtube.com/playlist?list=PLZchMekN22UmCqi9sCEEoAYBPsNvQrvBU)\n\n\n\nChange Log\n==========\n\n0.0.2 (17/06/2023)\n------------------\n- Fixed Circumcentre_3d function\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python library for 2d/3d coordinate geometry",
"version": "0.0.3",
"project_urls": {
"Homepage": "https://github.com/utkarsh-naman/utnamgeo"
},
"split_keywords": [
"cogeo",
"geometry",
"coordinate-geometry",
"math",
"evaluate",
"calculate"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8749356e3c6af73f87d904468f8eaf5a08a2fc22b37ba563c7506960711bad94",
"md5": "a7cb6e88e3a5fa5913661539c03de921",
"sha256": "e0e070bf8f42a8bb4cde8fe98c9bd5daa703ef02773c7903b6771b9f56563033"
},
"downloads": -1,
"filename": "utnamgeo-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a7cb6e88e3a5fa5913661539c03de921",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7007,
"upload_time": "2023-06-17T15:23:02",
"upload_time_iso_8601": "2023-06-17T15:23:02.065154Z",
"url": "https://files.pythonhosted.org/packages/87/49/356e3c6af73f87d904468f8eaf5a08a2fc22b37ba563c7506960711bad94/utnamgeo-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "64104b3c51ffcbe9d67dd6021ce1bcabfc7a7417e7c741ee1af6338c490f9912",
"md5": "f681e988d80d81e665bee57833e2ce60",
"sha256": "cded8695a092c5a387cf84df5721fe58000d58075763327b972d8ca95653140a"
},
"downloads": -1,
"filename": "utnamgeo-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "f681e988d80d81e665bee57833e2ce60",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8738,
"upload_time": "2023-06-17T15:19:07",
"upload_time_iso_8601": "2023-06-17T15:19:07.117349Z",
"url": "https://files.pythonhosted.org/packages/64/10/4b3c51ffcbe9d67dd6021ce1bcabfc7a7417e7c741ee1af6338c490f9912/utnamgeo-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-17 15:19:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "utkarsh-naman",
"github_project": "utnamgeo",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "utnamgeo"
}