/ Published in: Python
Effect of rotating the phase of the complex number
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# -*- coding: utf-8 -*- """ Created on Tue Aug 12 19:59:00 2014 @author: Anish """ # Importing libraries import os os.system('cls') import numpy as np import matplotlib.pyplot as plt #j = sqrt(-1) r0 = 2.0 theta = pi/4.0 x0 = r0*cos(theta) y0 = r0*sin(theta) zvec = [x0+1j*y0,x0-1j*y0, sqrt(x0**2 +y0**2), -x0-1j*y0,-x0+1j*y0] for ix in range(0, 5): x = real(zvec[ix]) y = imag(zvec[ix]) plot(x,y,'o') text(x, y,'z%1.0f'%(ix),fontsize = 12) plt.xlabel('real') plt.ylabel('imaginary')
URL: transformations of a complex number