Vector math implementation in Python 3