A package to work with 3D vectors in Spherical and Cartesian coordinates.
Project description
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
_to_spherical([x, y, z])
Returns a Vector opject based on [x, y, z]
cartesian cooridates.
to_cartesian()
Returns a list in the form of [x, y, z]
representing the corresponding Cartesian coordinates for a vector.
is_same()
Compares the length as well as angles theta and phi to determine equality. This is different to '=' which only checks for equality of the vector length.
dot(s_vector)
Returns the resultant scalar dot product of a vector with s_vector
.
cross(s_vector)
Returns Vector
resulting from the cross product of a vector with s_vector
.
angle(s_vector)
Returns the in-plane angle between a vector and s_vector
.
magnitude()
Returns the length of a vector.
unit()
Returns the corresponding unit vector of a vector.
addition and subtraction
Returns resulting Vector. Normal addition and subtraction is done through cartesian addition and subtraction operations.
multplication
Multiplication is implemented as scalar multiplication only. For dot and cross products the corresponding methods should be used.
comparison
All comparison operators returns comparison with length of vectors only.
Atributes
radius
Returns the length of a vector
theta
Returns the angle theta of a vector
phi
Returns the ancle phi of a vector
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
Hashes for threedvector-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32a6274a019005ae43e792b09dc0b417e7c6d107bc30baf5593d46278b640bab |
|
MD5 | c76ef23859906a30026ae1ffd98c86d4 |
|
BLAKE2b-256 | 6a3cd2f0072c2e4b5d16af10273381ca097c8d56c950ff70577a3ae8e0878021 |