下載Python3.3.2

參考圖書:

Python:

1. 徹底研究Python科學計算 by 張若愚(著) 胡嘉璽(譯)

2. Computing for the Sciences Using Python, Part 1 [Kindle Edition] by  Christoph Hoffmann, Leah Hoffmann, Lukasz Ziarek

3. Computing for the Sciences Using Python, Part 2 [Kindle Edition] by Christoph Hoffmann, Leah Hoffmann, Lukasz Ziarek

4. 深入淺出Python by Paul Barry (蔣大偉 譯)

5 Python 3 程式庫參考手冊 by 陳建勳

VPython:

1. Vpython by Ronald Cohn Jesse Russell

=========================================================================

成績考量以課堂表現(30%,含Zuvio互動的表現)、課堂實習(30%,簡單的程式實作)和分組報告(40%,學期末每組約十五分鐘的報告)三項來評量學生成績。

第二週測試Zuvio來確定系統的可信度,將於第三週開始記錄學生的互動結果列入學期成績考量。

第四週應給老師分組名單,第六週應給老師各組要在學期末報告的內涵。

=========================================================================

授課內容

第一週:

 週

Python

Math & CS (Background + CT + Program)

VPython

1. 9/11 a. How to install Python?
b. factorial example.
Assignment,
range,
Booleans,
If statement
,
Function, Argument/variable, return.
print
c. integer computation: +, -, *, /, //, %
Recursive vs. Repetitive

Exercise:
Give examples for n! using recursive and Repetitive technique.

Student Exercise:Write a summation program (add 1 to n) using both technique.

Homework: Calculate the gcd(m,n) recursively, where m, and n are two positive integers.

Homework: Define the function prime(n) which return True when n is a prime, or False otherwise.
 
三軸的繪製 江清水

2.

9/18

a.      Data Type: Numeric vs. String

b.      List (append)

 

Data Analyst from Web(new)

How to teach students Computational Thinking Ability by 江清水(new)

函數與圖形(from wiki; 略)

 參數式

Exercise:

Produce a list L, such that L[i] shows the summation from 0 to i.

Produce a list L, such that L[i] shows the summation from 0 to 10*i.

Student Exercise:

1. List a consecutive points of a circle into a list.
2. Show this circle on the screen. 

簡單的3D幾何物件繪製 江清水

繪製曲線。

2D Curve

Draw a circle.

for  (cos(q), sin(q))

for ((1-T2)/(1+T2), 2T/(1+T2)), where T=tan(q/2)

 

3

9/25

 Python Basic:

a.  Programming Language, Numbers, Booleans, Python Grammar, Statement, Math Library.

b.       How to define Function? Function for CS vs. Function for Math?

c.      First function in Python (factorial)

 

Bezier Curve (from wiki), and its matrix form

2D平面與3D空間(多邊形表示法,右手規則)

 

Tangent Field

for  (cos(q), sin(q))

for ((1-T2)/(1+T2), 2T/(1+T2)), where T=tan(q/2)

繪製2D參數式曲線。繪製Bezier Curve

3D Curve

Offset Curve for parabola.

1. 劃出一條拋物線的offset curve(距離為0.1)

2. 或出十條拋物線的offset curve(距離從0.1到1.0) 

4

10/2

  

Hermit Curve, and its matrix form.

Conversion between curves.

 

 Hermit Curve端點與切線,Bezier Curve控制點之轉換

Hermit Curve繪 製

Curve 轉換

5 雙十國慶,提前補放假一天

6

10/16

Sequence

 

 

List and Matrix 二元一次方程式求解。(無圖)
HW: 加入圖案

 

7

10/23

 Matrix

2D Geometry: Translation, Scaling and Rotation

3D Geometry

電腦動畫:
時鐘的製作
Frenet Frame在Helix上的動畫顯現

8

10/30

分組名單建立

a. Function again. Global and local variables

b. Loops

 

 

物件的放大縮小,平移和旋轉。

 

9

11/6

Tree

moreTree

parallel project vs. perspective projection
parallel projection, perspective projection.

10

11/13

Read from file vs. Write to file

coordinates transformation (world coordinates to eye coordinates, w2e, and e2w), 2D and 3D

 

w2e and e2w in 2D

11

11/20

Tree and Recursive

Library

Envolute

Envolute定理的驗證

12

11/27

Dragon Curve

3D Geometry: Rotation

 

13

12/4

Dictionary,Tuple, Set
曲面z=f(x,y)
 

雙曲線

參數式曲面

 Animation (Bezier Curve)

球體(sphere)的繪製

Bezier Surface的繪製

14

12/11

 

Project Introduction

Proj1

Proj2

proj3

Proj4

Proj5

 

Morphing

15

12/18

 學生報告

16
11/25
耶誕節放假一天
17
1/1
元旦放假一天

Syllabus

Python program syntax: assignment, boolean, if, range, for, def, parameter, return

VPython: The arrows

recursive vs. repetitive: Definition and Exercise.
Given the n factorial case, and ask students to do the summation from 1 to n.

 

第二週

 

 

以下僅供參考

Python 部分原始版本取自Purdue大學理學院和商學院必修課程之教材,經本人修訂後之投影片。Math&CS和VPython部分之教材若未註明出處則為本人所編撰,版權所有,請勿做營利用途。歡迎其他老師授課使用。

 週

Python

Math & CS

VPython

1

a.      How to install Python?

b.      Python Basic: Programming Language, Numbers, Booleans, Python Grammar, Statement, Math Library.

c.       How to define Function? Function for CS vs. Function for Math?

d.      First function in Python (factorial)

2D平面與3D空間(多邊形表示法,右手規則)

函數與圖形(from wiki; 略)

How to teach students Computational Thinking Ability by 江清水(new)

 Data Analyst from Web(new)

簡單的3D幾何物件繪製 江清水

三軸的繪製 江清水

 

2

a.      Assignment

b.      Data Type: Numeric vs. String

c.       Function, Argument/variable, return.

 參數式

繪製曲線。

2D Curve

3D Curve

3

 Function again. Global and local variables

 

Bezier Curve (from wiki), and its matrix form

Tangent Field

for  (cos(q), sin(q))

for ((1-T2)/(1+T2), 2T/(1+T2)), where T=tan(q/2)

4

a. Booleans

b.      If statement

Hermit Curve, and its matrix form.

Conversion between curves.

繪製2D參數式曲線。繪製Bezier Curve

5

a. List

b. Loops

List and Matrix Offset Curve for parabola.

1. 劃出一條拋物線的offset curve(距離為0.1)

2. 或出十條拋物線的offset curve(距離從0.1到1.0)

6

Sequence

 

2D Geometry: Translation, Scaling and Rotation

3D Geometry

物件的放大縮小,平移和旋轉。

7

Matrix

parallel project vs. perspective projection

parallel projection, perspective projection.

8

Tree

moreTree

coordinates transformation (world coordinates to eye coordinates, w2e, and e2w), 2D and 3D w2e and e2w in 2D

9

Read from file vs. Write to file

Conversion between two Curves

 

10

Tree and Recursive

Library

Envolute

Envolute定理的驗證

11

Dragon Curve

3D Geometry: Rotation

 Hermit Curve端點與切線,Bezier Curve控制點之轉換

Hermit Curve繪 製

Curve 轉換

12

Dictionary,Tuple, Set  

 Animation (Bezier Curve)

13

 

Project Introduction

Proj1

Proj2

proj3

Proj4

Proj5

 

Morphing

14

 曲面z=f(x,y)

雙曲線

球體(sphere)的繪製

15

 

參數式曲面

Bezier Surface的繪製

16

 學生報告