Monday, January 6, 2014

Random Python of the Morning

x = range(-10,10)
y = []

a = 3 # the positive or negative curvature
h = 0 # horizontal offset
k = 11 # vertical offset

# y = a * (xi – h)**2 + k
# y = a * xi ** 2 + b * xi + c

for xi in x:
    y.append(a * (xi + h)** 2 + k)

pylab.plot(x,y)

grid()
xlabel('$x$')
ylabel('$y$')
title('Parabolic Equation')

No comments:

Post a Comment