From 9306f888fea903accf827870a122a2f6f76e472e Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Wed, 18 May 2011 11:29:26 -0400 Subject: added some more documentation and a more accurate miniature version of lbne --- transform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'transform.py') 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]]) -- cgit