Skip to content

Instantly share code, notes, and snippets.

@elyase
Created March 20, 2014 13:55
Show Gist options
  • Select an option

  • Save elyase/9664266 to your computer and use it in GitHub Desktop.

Select an option

Save elyase/9664266 to your computer and use it in GitHub Desktop.
from math import sin, cos, pi
l = list()
for alpha in np.linspace(0,90,90):
alpha = alpha*pi/180 # plane angle in radians
R = np.matrix([ [cos(alpha) , 0, sin(alpha)],
[0 , 1, 0],
[-sin(alpha), 0, cos(alpha)] ])
rotated = np.matrix(data[['X','Y','Z']])*R
l.append(rotated.std(axis=0))
standard_devs = pd.DataFrame(np.vstack(l), columns=['std(X)','std(Y)','std(Z)'])
standard_devs.plot()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment