Created
February 5, 2017 20:52
-
-
Save zeffii/7fd0c1ba5661a3d4ca9f75c3bdd6393f to your computer and use it in GitHub Desktop.
hugglu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import svrx | |
from svrx.util.transforms import vector_norm | |
import numpy as np | |
u = np.array( | |
[ | |
[1,1,1], | |
[2,2,2] | |
] | |
) | |
new_u = np.empty(np.shape(u)) | |
for idx, v in enumerate(u): | |
new_u[idx] = v / np.sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]) | |
print(new_u) | |
A = np.power(u, 2) | |
B = np.sum(A, axis=1) | |
C = np.sqrt(B) | |
D = u / C | |
print(D) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment