In [1]:
%pylab
%matplotlib inline
In [2]:
# e^i\alpha som rotasjon:
x = array([0,4,4,5,4,2,2,1,1,0,-1,0,0,NaN,2,2,3,3,NaN,0.5,0.5,1.5,1.5,0.5, NaN,2.5,2.5,3.5,3.5,2.5])
y = array([0,0,6,5,7,7,8,8,7,7,5,6,0,NaN,0,2,2,0,NaN,3,4.5,4.5,3,3,NaN,3,4.5,4.5,3,3])
z = x+1j*y
plot(z.real, z.imag)
axis('equal')
Out[2]:
In [3]:
alfa = 2.2 # rotasjonsvinkel
rotasjon = exp(1j*alfa)
z1 = rotasjon*z
plot(z1.real, z1.imag)
axis('equal')
Out[3]:
In [4]:
def rotate(alfa=0):
figure(figsize=(4,4))
rot = exp(1j*alfa)
z1 = rot*z
plot(z1.real, z1.imag)
axis((-10,10,-10,10))
In [5]:
import ipywidgets as widgets
widgets.interact(rotate, alfa=(0.,2*pi,.1))
Out[5]: