Entry 3072

transcendental

   

Submitted by anonymous on Jan. 22, 2010 at 10:46 p.m.
Language: Python. Code size: 421 bytes.

import numpy
import pylab

""" plot the surface of f(x)+f(y)=c
      
    f(x)=x**2 + 3*x+ 6 
    f(y)= y
    c=3 
"""

x=numpy.arange(0,5,0.05)
y=numpy.arange(0,5,0.05)

def funcz(x,y):
  return x**2 + 3*x+ y +3 

vals=numpy.zeros((len(x),len(y)))
for i in range(len(x)):
  for j in range(len(y)):
     vals[i][j]=funcz(x[i],y[j])

pylab.imshow(vals,origin="lower")
pylab.colorbar()
pylab.savefig("transcendental.png")

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).