day1/exercise/funcs2.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Wed, 11 Nov 2009 12:30:18 +0530
changeset 302 8ea4739a7f1f
parent 64 333092b68926
permissions -rw-r--r--
Added tag goaandcalicut-v.10112009 for changeset 49bdffe4dca5

import math

def linspace(a, b, N):
    lns = []
    step = (float(b) - float(a)) / float(N - 1)
    print step
    for i in range(N):
        lns.append(a + i*step)

    return lns

def sin_func():
    x = linspace(0, 5, 11)
    sin_list = []
    for i in x:
        sin_list.append(math.sin(i))

    print sin_list

def sinsin_func():
    x = linspace(0, 5, 11)
    sin_list = []
    for i in x:
        sin_list.append(math.sin(i) + math.sin(10*i))

    print sin_list

sinsin_func()