Skip to main content

A package with for classes Vector (2d, 3d, 4d, Nd).

Project description

Vector pkg

Actual version : 2.0.2

How to install

pip install vector-pkg-enderrayquaza
Vector2d
import Vector.Vector2d as vec2
v = vec2.Vector2d(5, 7.5) #Creates a instance of Vector2d
print(v.x) #Shows his composant x >>> 5
print(v.y) #Idem                  >>> 7.5
print(v.st) #Shows his standard   >>> 9.013878188659973

u = vec2.Vector2d(-8, 0.25) #Creates an other instance of Vector2d
w = v+u #Makes a instance of Vector with composants (v.x + u.x; v.y + u.y)
print(w.x, w.y) # >>> -3 7.75
w = v-u #Idem but with a subtraction
print(w.x, w.y) # >>> 13 7.25

k = 5
w = v*k
print(w.x, w.y) # >>> 25, 37.5

#You can do this too
v += u
v -= u
v *= k

p = v**u #Calculates the scalar product of v and u          
print(p) # >>> -38.125
a = v%u  #Calculates the angle (in degrees) between v and u
print(a) # >>> 121.90015691773374
z = complex(v) #Makes a complex number equal at x+yi
print(z) # >>> (5+7.5j)

You can use the constant V0_ which is worth Vector2d(0, 0)

Vector3d
import Vector.Vector3d as vec3
v = vec3.Vector3d(5, 7.5, 0) #Creates a instance of Vector3d
print(v.x) #Shows his composant x >>> 5
print(v.y) #Idem                  >>> 7.5
print(v.z) #Idem                  >>> 0
print(v.st) #Shows his standard   >>> 9.013878188659973

u = vec3.Vector3d(-8, 0.25, 2) #Creates an other instance of Vector3d
w = v+u #Makes a instance of Vector with composants (v.x + u.x; v.y + u.y; v.z + u.z)
print(w.x, w.y, w.z) # >>> -3 7.75 2
w = v-u #Idem but with a subtraction
print(w.x, w.y, w.z) # >>> 13 7.25 -2

k = 5
w = v*k
print(w.x, w.y, w.z) # >>> 25, 37.5 0

#You can do this too
v += u
v -= u
v *= k

p = v**u #Calculates the scalar product of v and u          
print(p) # >>> -38.125
a = v%u  #Calculates the angle (in degrees) between v and u
print(a) # >>> 121.90015691773374

You can use the constant V0_ which is worth Vector3(0, 0, 0)

Vector4d

Idem that Vector3d and Vector2d but with a 4th composant t (for time).

VectorNd
import Vector.VectorNd as vecN
v = vecN.VectorNd([8, 6, 9, 2.7, -4])

The rest is like other Vector classes.

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

vector-pkg-enderrayquaza-2.0.5.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

vector_pkg_enderrayquaza-2.0.5-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file vector-pkg-enderrayquaza-2.0.5.tar.gz.

File metadata

  • Download URL: vector-pkg-enderrayquaza-2.0.5.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

File hashes

Hashes for vector-pkg-enderrayquaza-2.0.5.tar.gz
Algorithm Hash digest
SHA256 30489aa42cb6ebf856a89634087538f4afaa48204c4f253a9b442ef18e368671
MD5 4527c1ebda2dc98a3a15dc25fc8ee7f4
BLAKE2b-256 d38d7c4d750ad58d0edcd9cd2926b21a95e6a4377896fb763155493cdfe4e0ab

See more details on using hashes here.

File details

Details for the file vector_pkg_enderrayquaza-2.0.5-py3-none-any.whl.

File metadata

  • Download URL: vector_pkg_enderrayquaza-2.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

File hashes

Hashes for vector_pkg_enderrayquaza-2.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0d37523231959d44420af3a1a770812cf9c77a8addafa7f8ed4935b9e7887f28
MD5 c83e362d772bb47c180cbc277102ab41
BLAKE2b-256 e519f37672ef688bcab3e839fae8aff6d86d242e6ae0479e484bcd7f182ea6d1

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