import matplotlib.pyplot as plt
from math import e, pi
import numpy as np

X = np.linspace(0,2*pi,1000)


def sin():

    Y = np.array([])

    for omega in X:
        Y = np.append(Y, (e**(1j*omega)).imag)

    return Y
##    fig = plt.figure()
##    ax = plt.axes()
##
##    plt.plot(X, Y)
##    plt.show()

def cos():
    Y = np.array([])

    for omega in X:
        Y = np.append(Y, (e**(1j*omega)).real)

    return Y
##    fig = plt.figure()
##    ax = plt.axes()
##
##    plt.plot(X, Y)
##    plt.show()


plt.figure(1)

plt.subplot(121)
Y_sin = sin()
plt.plot(X, Y_sin)
##plt.yscale('kruznica')
plt.title('sin')
plt.grid(True)

plt.subplot(122)
X_cos = cos()
plt.plot(X, X_cos)
##plt.yscale('spirala')
plt.title('cos')
plt.grid(True)


plt.show()
