KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/share/doc/python-numeric-23.7/Demo/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/python-numeric-23.7/Demo/mandelbrot.py
#!/usr/bin/env python
#
# Mandelbrot ASCII-art using Numeric Python 1.0beta1
#
# Rob Hooft, 1996. Distribute freely.

from Numeric import *

def draw(LowX, HighX, LowY, HighY, stepx=80, stepy=24, maxiter=30):
	xx=arange(LowX,HighX,(HighX-LowX)/stepx)
	yy=arange(HighY,LowY,(LowY-HighY)/stepy)*1j
	c=ravel(xx+yy[:,NewAxis])
	z=zeros(c.shape,Complex)
	output=resize(array(['_'],'c'),c.shape)
	for iter in range(maxiter):
		z=z*z+c
		finished=greater(abs(z),2.0)
		c=where(finished,0+0j,c)
		z=where(finished,0+0j,z)
		output=where(finished,chr(66+iter),output)
	return output.tostring()


if __name__ == "__main__":
	print draw(-2.1, 0.7, -1.2, 1.2)



Anon7 - 2021