Back to index

python3.2  3.2.2
Functions | Variables
turtledemo.chaos Namespace Reference

Functions

def f
def g
def h
def jumpto
def line
def coosys
def plot
def main

Variables

int N = 80

Function Documentation

Definition at line 28 of file chaos.py.

00028 
00029 def coosys():
00030     line(-1, 0, N+1, 0)
00031     line(0, -0.1, 0, 1.1)

Here is the call graph for this function:

Here is the caller graph for this function:

def turtledemo.chaos.f (   x)

Definition at line 11 of file chaos.py.

00011 
00012 def f(x):
00013     return 3.9*x*(1-x)

def turtledemo.chaos.g (   x)

Definition at line 14 of file chaos.py.

00014 
00015 def g(x):
00016     return 3.9*(x-x**2)

def turtledemo.chaos.h (   x)

Definition at line 17 of file chaos.py.

00017 
00018 def h(x):
00019     return 3.9*x-3.9*x*x

def turtledemo.chaos.jumpto (   x,
  y 
)

Definition at line 20 of file chaos.py.

00020 
00021 def jumpto(x, y):
00022     penup(); goto(x,y)

Here is the caller graph for this function:

def turtledemo.chaos.line (   x1,
  y1,
  x2,
  y2 
)

Definition at line 23 of file chaos.py.

00023 
00024 def line(x1, y1, x2, y2):
00025     jumpto(x1, y1)
00026     pendown()
00027     goto(x2, y2)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 43 of file chaos.py.

00043 
00044 def main():
00045     reset()
00046     setworldcoordinates(-1.0,-0.1, N+1, 1.1)
00047     speed(0)
00048     hideturtle()
00049     coosys()
00050     plot(f, 0.35, "blue")
00051     plot(g, 0.35, "green")
00052     plot(h, 0.35, "red")
00053     # Now zoom in:
00054     for s in range(100):
00055         setworldcoordinates(0.5*s,-0.1, N+1, 1.1)
00056     return "Done!"

Here is the call graph for this function:

def turtledemo.chaos.plot (   fun,
  start,
  colour 
)

Definition at line 32 of file chaos.py.

00032 
00033 def plot(fun, start, colour):
00034     pencolor(colour)
00035     x = start
00036     jumpto(0, x)
00037     pendown()
00038     dot(5)
00039     for i in range(N):
00040         x=fun(x)
00041         goto(i+1,x)
00042         dot(5)

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 9 of file chaos.py.