Skip to content

Instantly share code, notes, and snippets.

@toyballz
Created November 10, 2020 17:57
Show Gist options
  • Save toyballz/d765329a58bba353818e6427f13fb57e to your computer and use it in GitHub Desktop.
Save toyballz/d765329a58bba353818e6427f13fb57e to your computer and use it in GitHub Desktop.
# @ is explicit operator for the dot product
def proj_matrix(v):
return v @ np.linalg.inv(v.T@v) @ v.T
def proj(vector, plane):
return proj_matrix(vector) @ plane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment