Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover Page
Title Page
Copyright Page
Dedication
ABOUT THE AUTHOR
ABOUT THE TECHNICAL REVIEWER
BRIEF CONTENTS
CONTENTS IN DETAIL
ACKNOWLEDGMENTS
INTRODUCTION
The Problem with School Math
About This Book
Who Should Use This Book
What’s in This Book?
Downloading and Installing Python
Starting IDLE
Installing Processing
PART I: HITCHIN’ UP YOUR PYTHON WAGON
1 DRAWING POLYGONS WITH THE TURTLE MODULE
Python’s turtle Module
Repeating Code with Loops
Creating Shortcuts with Functions
Using Variables to Draw Shapes
Equilateral Triangles
Summary
2 MAKING TEDIOUS ARITHMETIC FUN WITH LISTS AND LOOPS
Basic Operators
Data Types in Python
Using Lists to Store Values
Using Lists in Loops
Summation
Finding the Average of a List of Numbers
Summary
3 GUESSING AND CHECKING WITH CONDITIONALS
Comparison Operators
Making Decisions with if and else Statements
Using Conditionals to Find Factors
Creating a Number-Guessing Game
Finding Square Roots
Summary
PART 2: RIDING INTO MATH TERRITORY
4 TRANSFORMING AND STORING NUMBERS WITH ALGEBRA
Solving First-Degree Equations
Solving Higher-Degree Equations
Solving Equations Graphically
Summary
5 TRANSFORMING SHAPES WITH GEOMETRY
Drawing a Circle
Specifying Location Using Coordinates
Transformation Functions
Animating Objects
Creating an Interactive Rainbow Grid
Drawing Complex Patterns Using Triangles
Summary
6 CREATING OSCILLATIONS WITH TRIGONOMETRY
Using Trigonometry for Rotations and Oscillations
Writing Functions to Draw Polygons
Making Sine Waves
Creating a Spirograph Program
Making Harmonographs
Summary
7 COMPLEX NUMBERS
The Complex Coordinate System
Adding Complex Numbers
Multiplying a Complex Number by i
Multiplying Two Complex Numbers
Writing the magnitude() Function
Creating the Mandelbrot Set
Creating the Julia Set
Summary
8 USING MATRICES FOR COMPUTER GRAPHICS AND SYSTEMS OF EQUATIONS
What Is a Matrix?
Adding Matrices
Multiplying Matrices
Order Matters in Matrix Multiplication
Drawing 2D Shapes
Transforming Matrices
Transposing Matrices
Rotating Matrices in Real Time
Creating 3D Shapes
Creating the Rotation Matrix
Solving Systems of Equations with Matrices
Summary
PART 3: BLAZING YOUR OWN TRAIL
9 BUILDING OBJECTS WITH CLASSES
Bouncing Ball Program
Grazing Sheep Program
Summary
10 CREATING FRACTALS USING RECURSION
The Length of a Coastline
Koch Snowflake
Sierpinski Triangle
Square Fractal
Dragon Curve
Summary
11 CELLULAR AUTOMATA
Creating a Cellular Automaton
Python Lists Are Strange
Playing the Game of Life
The Elementary Cellular Automaton
Summary
12 SOLVING PROBLEMS USING GENETIC ALGORITHMS
Using a Genetic Algorithm to Guess Phrases
Solving the Traveling Salesperson Problem (TSP)
Summary
INDEX
← Prev
Back
Next →
← Prev
Back
Next →