threedvector Package
threedvector is a package providing common methods for working with 3D vectors in both Spherical and Cartesian coordinates.
Vectors are stored in Spherical format but can be created in both Spherical and Cartesian formats.
Methods
copy(other)
Returns a Vector object representing a copy of other
Instance Methods
init(radius_x=0, theta_y=0, phi_z=0, coords="spherical")
Default Vector creation is in the Spherical coordinate system where coords is set to "spherical". radius_x represents the length of the vector, theta_y the polar angle, theta and phi_z the azimuthal angle, phi.
A Vector can be created using Cartesian coordinates with coords set to "cartesian" instead of "spherical". In this case radius_x represents the x coordinate, theta_y the y coordinate and phi_z the z coordinate.
cartesian()
Returns a list in the form of [x, y, z] representing the corresponding Cartesian coordinates of a vector.
is_same(s_vector)
Compares the length as well as angles theta and phi of vector with s_vector to determine equality. This is different to '=' which only checks for equality of the vector length.
dot(s_vector)
Returns a float as the resultant dot product of a vector with s_vector.
cross(s_vector)
Returns the Vector object resulting from the cross product of a vector with s_vector.
angle(s_vector)
Returns a float as the in-plane angle in degrees between a vector and s_vector.
unit()
Returns a Vector object as the corresponding unit vector of a vector.
magnitude()
Returns a float as the length of a vector
theta()
Returns a float as the polar angle theta of a vector in degrees
phi()
Returns a float as the azimuthal angle phi of a vector in degrees
set_magnitude(magnitude)
Sets the length of a vector to magnitude
set_theta(theta)
Sets the polar angle, theta, of a vector to theta in degrees
set_phi(phi)
Sets the azimuthal angle, phi, of a vector to phi in degrees
addition and subtraction
Returns resulting Vector object. Normal addition and subtraction are done through Cartesian addition and subtraction operations.
multiplication
Multiplication is implemented as scalar multiplication only. For dot and cross products, the corresponding methods should be used.
comparison
All comparison operators return comparison with length of vectors only.
Metadata
Release files for threedvector 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| threedvector-0.3.3.tar.gz | 3.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| threedvector-0.3.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.8 kB
Release files / threedvector-0.3.3.tar.gz
| Download URL | threedvector-0.3.3.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6975d3459340a125b7cc40fc7d98de22cdd000c836f9896e9170ce71e58fd0a3
|
|
BLAKE2b-256 checksum How to use checksums |
209f2b79093eb5410b347584dd22f59b725cfe1b6e4297587f6a77941b94eafd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
|
Release files / threedvector-0.3.3-py3-none-any.whl
| Download URL | threedvector-0.3.3-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f4effd6391e139d75e9baeb63244ee1aab7670f25da25884c0de36c8fdb0eee
|
|
BLAKE2b-256 checksum How to use checksums |
f2692e2f5f8fd7a09362388c3b873354b2a332c55cf5cb6e63da536d792102f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
|
Security for threedvector 0.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.