Skip to main content

Vector and linear algebra toolbelt for NumPy

Project description


version license build docs build code style

Vector and linear algebra toolbelt for NumPy.


  • normalize normalizes a vector.
  • sproj computes the scalar projection of one vector onto another.
  • proj computes the vector projection of one vector onto another.
  • reject computes the vector rejection of one vector from another.
  • reject_axis zeros or squashes one component of a vector.
  • magnitude computes the magnitude of a vector.
  • angle computes the unsigned angle between two vectors.
  • signed_angle computes the signed angle between two vectors.
  • almost_zero tests if a vector is almost the zero vector.
  • almost_collinear tests if two vectors are almost collinear.
  • pad_with_ones adds a column of ones.
  • unpad strips off a column (e.g. of ones).
  • apply_homogeneous applies a transformation matrix using homogeneous coordinates.
  • Complete documentation:


pip install numpy vector_shortcuts


import numpy as np
import vx

projected = vx.sproj(np.array([5.0, -3.0, 1.0]), onto=vx.basis.neg_y)


Pull requests welcome!


If you are having issues, please let us know.


This collection was developed at Body Labs by Paul Melnikow and extracted from the Body Labs codebase and open-sourced as part of blmath by Alex Weiss. blmath was subsequently forked by Paul Melnikow and later this namespace was broken out into its own package.


The project is licensed under the two-clause BSD license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for vector-shortcuts, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size vector_shortcuts-0.2.1.tar.gz (8.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page