A small vector library
Project description
melvec
A small vector library for python
Installation:
To install this package type pip install melvec
in a console/terminal.
Usage:
To import the package in your code use: import melvec
.
To create a 2D-Vector use: melvec.Vec2()
.
To create a 3D-Vector use: melvec.Vec3()
.
For easy access to the vector classes it is recommended import the classes directly with: from melvec import Vec2, Vec3
.
Example code snippets:
Using import melvec
:
import melvec
u = melvec.Vec2(10, 2)
v = melvec.Vec2(3, 3)
w = u + v # -> Vec(13, 5)
print(u.dot(w)) # -> 140
Using from melvec import Vec2, Vec3
:
from melvec import Vec2, Vec3
u = Vec2(10, 2)
v = Vec2(3, 3)
w = u + v # -> Vec(13, 5)
print(u.dot(w)) # -> 140
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
melvec-0.0.9.tar.gz
(3.7 kB
view hashes)
Built Distribution
melvec-0.0.9-py3-none-any.whl
(4.7 kB
view hashes)