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, andzcomponents directly. - Predefined Unit Vectors: Unit vectors along the
x,y, andzaxes. - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91adb396f6df19d372ad9a698724fec37f92213c7866b5e52c1649e970198fdd
|
|
| MD5 |
090c050953b9210ef457b5322f0f2f72
|
|
| BLAKE2b-256 |
50a331d73cdbba793d757577b18dffc78ed7925139591c43c58d1651f9cf0106
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6aac644d03c4fe2a4038824ceb23e8675fb39a4a721cd4c0b00a5e46cef1183a
|
|
| MD5 |
70440801b60b4cb9a4ee1eb6480c6e9a
|
|
| BLAKE2b-256 |
d5121039e3047101b5d54b0bd6c5e3c602f1002f3f03a7972cf925b20067d536
|