Skip to main content

A 3D geometry library that provides a vector3d class for performing 3D vector operations using NumPy.

Project description

Model3d

Overview

This library provides a Vector3d class for performing 3D vector operations using NumPy. It supports fundamental vector calculations such as dot product, cross product, magnitude, normalization, and parallelism checks.

Features

  • Basic Vector Operations: Dot product, cross product, magnitude, and unit vector computation.
  • Component Access: Access and modify x, y, and z components directly.
  • Predefined Unit Vectors: Unit vectors along the x, y, and z axes.
  • Vector Comparisons: Check equality and parallelism of vectors.
  • Orthogonalization: Gram-Schmidt process for generating orthogonal vectors.

Installation

pip install numpy  # Ensure NumPy is installed

Usage

import numpy as np
from vector3d import Vector3d

# Create a new vector
v1 = Vector3d([1, 2, 3])
v2 = Vector3d([4, 5, 6])

# Compute magnitude and unit vector
print(v1.magnitude())  # Output: Magnitude of v1
print(v1.unit())       # Output: Unit vector of v1

# Perform dot and cross products
dot = v1.dot_product(v2)
cross = v1.cross_product(v2)

print(dot)   # Output: Dot product of v1 and v2
print(cross) # Output: Cross product of v1 and v2

# Check parallelism
print(v1.is_parallel_to(v2))

# Access and modify components
print(v1.x, v1.y, v1.z)
v1.x = 10  # Update x component
print(v1)

License

This project is licensed under the MIT License.

Contributions

Contributions are welcome! Feel free to open issues and submit pull requests.

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

model3d-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

model3d-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file model3d-0.1.0.tar.gz.

File metadata

  • Download URL: model3d-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for model3d-0.1.0.tar.gz
Algorithm Hash digest
SHA256 91adb396f6df19d372ad9a698724fec37f92213c7866b5e52c1649e970198fdd
MD5 090c050953b9210ef457b5322f0f2f72
BLAKE2b-256 50a331d73cdbba793d757577b18dffc78ed7925139591c43c58d1651f9cf0106

See more details on using hashes here.

File details

Details for the file model3d-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: model3d-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for model3d-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6aac644d03c4fe2a4038824ceb23e8675fb39a4a721cd4c0b00a5e46cef1183a
MD5 70440801b60b4cb9a4ee1eb6480c6e9a
BLAKE2b-256 d5121039e3047101b5d54b0bd6c5e3c602f1002f3f03a7972cf925b20067d536

See more details on using hashes here.

Supported by

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