Return to Snippet

Revision: 67090
at August 8, 2014 12:23 by aturlapaty


Initial Code
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 04 22:20:13 2014

@author: Anish
"""

# -*- coding: utf-8 -*-
"""
Spyder Editor

"""
# Importing libraries 
import os
os.system('cls')
import numpy as np
import matplotlib.pyplot as plt
import math
#------------------------------------------------------------------------------
# Parameters 
N = 145.0;
k = 1.0
#l = 5.0;
#------------------------------------------------------------------------------
# Definition of the array and the sinusoids 
nvec = np.linspace(-N+1, N-1, num=N)
y1 = tan(pi*k*nvec/N)
#y2 = cos(2.0*pi*l*nvec/N)
#------------------------------------------------------------------------------
# Plotting
plt.plot(180*nvec/N,y1,'or-')

plt.ylabel('Tanget',fontsize=14, color='blue')
plt.xlabel('Angle (Degrees)',fontsize=14, color='blue')
plt.show()
#------------------------------------------------------------------------------

Initial URL
PlotTanX

Initial Description
This code is connected to following youtube video on complex plane. 
http://youtu.be/oPIEH6hivEw

Initial Title
Plot tanx function

Initial Tags


Initial Language
Python