/mega_vector

A basic pure python vector manipulation library because I got sick of copy pasting it

Primary LanguagePythonMIT LicenseMIT

1. mega_vector

A basic pure python vector manipulation library because I got sick of copy pasting it.

PyPI - Version PyPI - Python Version


Table of Contents

1. Installation

pip install mega-vector

2. Features

2.1. Conversion to String

print(Vector3(1,2,0))
'❬1.00, 2.00, 0.00❭'

2.2. Conversion to String with format string

f"{Vector3(1,2,0):>7.3f}"
'❬  1.000,   2.000,   0.000❭'

2.3. Conversion to list or tuple or dict

list(Vector3(1,2,0))
tuple(Vector3(1,2,0))
dict(zip("xyz",Vector3(1,2,0)))
[1,2,0]
(1,2,0)
{'x': 1, 'y': 2, 'z': 0}

2.4. Conversion to numpy.ndarray

np.array(Vector3(1,2,0))
array([1, 2, 0])

3. License

mega-vector is distributed under the terms of the MIT license.