summaryrefslogtreecommitdiff
path: root/transform.py
diff options
context:
space:
mode:
Diffstat (limited to 'transform.py')
-rw-r--r--transform.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/transform.py b/transform.py
index cab23fb..1321c8c 100644
--- a/transform.py
+++ b/transform.py
@@ -8,7 +8,7 @@ def rotate(x, phi, n):
Source: Weisstein, Eric W. "Rotation Formula." Mathworld.
"""
x = np.asarray(x)
- n = np.asarray(n)
+ n = np.asarray(n)/np.linalg.norm(n)
r = np.cos(phi)*np.identity(3) + (1-np.cos(phi))*np.outer(n,n) + \
np.sin(phi)*np.array([[0,n[2],-n[1]],[-n[2],0,n[0]],[n[1],-n[0],0]])