Skip to main content

Geometry Definition and Calculation Package for Python

Project description

pygeom

Geometry Definition and Calculation Package for Python

Contains:

  1. 2D and 3D vectors for vector dot products using "*" and vector cross products using "**".
  2. 2D and 3D cubic splines for calculating the various directions and curvatures at every point.
  3. 2D and 3D transformations and coordinate systems for transforming vectors and points.

Vector Example Code:

# Import Vector Class
from pygeom.geom3d import Vector

# Vector object creation
vec1 = Vector(2.0, 3.0, 1.0)
print(f'vec1 = {vec1:g}')

# Multiply vector by a scalar
vec2 = 2*vec1
print(f'vec2 = {vec2:g}')

# Vector attributes are x, y, and z
vec3 = Vector(vec2.y, vec2.z, vec2.z)
print(f'vec3 = {vec3:f}')

# Vector cross product
vec4 = vec1.cross(vec2)
print(f'vec4 = {vec4:g}')

# Vector cross product
vec5 = vec1.cross(vec3)
print(f'vec5 = {vec5:g}')

# Vector dot product
scal = vec1.dot(vec2)
print(f'scal = {scal:g}')

# Get vector magnitude
mag = vec5.return_magnitude()
print(f'mag = {mag:g}')

# Get the unit vector
uvec = vec5.to_unit()
print(f'uvec = {uvec:f}')

Vector Example Output:

vec1 = <2, 3, 1>
vec2 = <4, 6, 2>
vec3 = <6.000000, 2.000000, 2.000000>
vec4 = <0, 0, 0>
vec5 = <4, 2, -14>
scal = 28
mag = 14.6969
uvec = <0.27217, 0.13608, -0.95258>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygeom-0.0.13.tar.gz (58.0 kB view details)

Uploaded Source

Built Distribution

pygeom-0.0.13-py3-none-any.whl (78.5 kB view details)

Uploaded Python 3

File details

Details for the file pygeom-0.0.13.tar.gz.

File metadata

  • Download URL: pygeom-0.0.13.tar.gz
  • Upload date:
  • Size: 58.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pygeom-0.0.13.tar.gz
Algorithm Hash digest
SHA256 8b00d5fcca90d51a330866b594a14098ab1961acb8299b1e096349be24c598f6
MD5 72ac2d67c0bcd434884a1f29fe95ee08
BLAKE2b-256 8c722b7922ea4a73a823b7452254ee7adaf9bbda439eebcc9f3b0af2c519218f

See more details on using hashes here.

File details

Details for the file pygeom-0.0.13-py3-none-any.whl.

File metadata

  • Download URL: pygeom-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 78.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pygeom-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 cd8c15a8eff495fa003c3a37d3c1edf2037b776f65e31ea98907371c880cda42
MD5 80172df4816d5c45999ab695c217d2df
BLAKE2b-256 10a95e203d30a1ae0458cf91f48c34f0983af733e6d7f1c52efb4e68ba4522ef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page