This week we will devote time to plan the Math day on parents weekend and also learn about function and using them to change colors.
Below is a small program that I wrote which is based on the following principle
The Sin ranges from -1 to 1 and the RGB colors take input from 0 to 255 so:
In order to use the SIN function with colors we first need to make it positive (by squaring it) and next we multiply it by 255.
We will
local c1 x y s
t=0
loop 100000 [t=t+0.00001
c1=255*(Sin(360*3*t))^2
x=100*t y=100*t
jt x y color rgb c1 c1 c1 [circle 20]
x=-100*t y=100*t
jt x y color rgb c1 c1 c1 [circle 20]
]
Class discussions:
1. What does x=100*t y=100*t do in the program?
2. using more traditional mathematical notation from algebra and calculus. What is the equation
of the two lines.
3. What would you do in the program to add two more lines that will create a dynamic symmetry (everything will look "perfect" and happen at the same time)
4. How would you change the program so that the movement will happen along parabolas (say with an equation like y=x^2 etc...
5. In what other ways can you change colors. Let us discuss it and implement it.
6. What other functions do we know? How to implement them? What other curves can we think about and how can we implement them
7. In what other ways can we change colors creatively?
8. How can we change the sizes of shapes we are doing.
HW for next two weeks:
1. for next week: Summarize in this blog the answers to these questions in your own way and share some ideas and techniques. help others. they will appreciate your creativity.
2. For next week. Come to the Math day even for just a few minutes. If you can help more
3. Two weeks for today. Create your first major math art piece to show to the class and try to add music also. It will be asam (sp?). The name of the directory to save your work is Project_11_11_07
Sunday, October 28, 2007
Monday, October 22, 2007
Walking the Labyrinth.
The labyrinth is a sacred mathematical and spiritual path that allows one to connect with their soul. Our classes will build the Labyrinth today (10/22/07) and each one of us either alone or with a friend will walk it sometime before 11:00 tomorrow morning (10/23/07). Please use this blog to record and share your experience.
Saturday, October 20, 2007
Week 8: Introduction to Function HW Due 10/29
1. Review Introduction to Function Unit and practice the examples there.
2. The following program draws a graph function
local x y
t=0
loop 10000 [t=t+0.0001 x=150*t y=70*Sin(4*360*t) jt x 0
FD y]
A. What is the period of the graph?
B. How would you slow the program by a factor of 10? What will you change? This means the program will run 10 times slower.
C. Why do we need the commands x=150*t jt x 0 in the program?
D. What does the number 150 control in the program?
E. What will you change in the program so that it will not fill in the area but just draw the graph of the function itself? Hint: Instead of FD y try GOFD y or JT x y
F. What will you change in the program to make it draw a circle of diameter 100 with random colors ranging from 0 to 511
G. What will you change in the program to make it draw a spiral with random colors
H. Create a suprize piece of Mathematical Art and paste to code in your answer.
2. The following program draws a graph function
local x y
t=0
loop 10000 [t=t+0.0001 x=150*t y=70*Sin(4*360*t) jt x 0
FD y]
A. What is the period of the graph?
B. How would you slow the program by a factor of 10? What will you change? This means the program will run 10 times slower.
C. Why do we need the commands x=150*t jt x 0 in the program?
D. What does the number 150 control in the program?
E. What will you change in the program so that it will not fill in the area but just draw the graph of the function itself? Hint: Instead of FD y try GOFD y or JT x y
F. What will you change in the program to make it draw a circle of diameter 100 with random colors ranging from 0 to 511
G. What will you change in the program to make it draw a spiral with random colors
H. Create a suprize piece of Mathematical Art and paste to code in your answer.
Week 8: Introduction to functions
We will introduce this post to fun functions in SeeLogo and the result will be beautiful presentation for our December 10 Exhibition:
We start the session by declaring the global time variable t
(type declare t)
Our first function is P1:
New P1
jt 0 100
t=0
loop 10 [t=t+0.1 wrnum t]
The result is that 10 numbers from 0.1 to 1 will be displayed. For convenience we will always have the time t change from 0 to 1.
The next program is similar except that now 1000 numbers are displayed. This will allow smoother projections of movements on the screen that will be more pleasing to the senses.
New P1A
jt 0 100
t=0
loop 1000 [t=t+0.001 wrnum t]
jt -100 0
wrnum t
//Notice that t=t+0.001. This is not an accident since we ask that t is between 0 and 1.
The Next Program defines a function y where y=100*t (similar to y=100*x that you may be more familiar with)
New P2
local y
t=0
loop 1000 [t=t+0.001 y=100*t wrnum y]
JT -100 0
wrnum t
wrnum y
Next function is based on the Sin(x) function which you may heard about. We will explain it in detail in class: The actual function here is y=40*Sin(360*t) and it has a single period. This may seems strange at first but after a while will make sense.
NEW P3
local y
t=0
loop 100 [t=t+0.01 y=40*Sin(360*t)
fd y bk y gomv 1 0 wait 0.1]
The next program is just like the previous one but with 3 periods.
NEW P3A
local y
t=0
loop 100 [t=t+0.01 y=40*Sin(3*360*t)
fd y bk y gomv 1 0 wait 0.1]
The next program uses the definition of the Sin and Cos Functions to make a colored circle
NEW P3B
local x y
t=0
loop 100000 [t=t+0.00001
x=100*Cos(360*t)
y=100*Sin(360*t)
jt x y color rnd 512 [circle 8]]
The next two programs show what rich potential we have here. Next week we will learn about functions and colors. Once you start mastering the technique you become a Mathematical artist. Please be patient. It takes some time to get used to the new concepts but they are not difficult.
NEW P3C
local x y d
t=0
loop 100000 [t=t+0.00001
d=30*(Sin(360*3*t))^2
x=100*Cos(360*t)
y=100*Sin(360*t)
jt x y color rnd 511 [circle d]]
New P3D
local x y d r
t=0
loop 100000 [t=t+0.00001
d=30*(Sin(360*2*t))^2
r=60*(Sin(360*2*t))
x=r*Cos(360*t)
y=r*Sin(360*t)
jt x y color rnd 511 [circle d]]
We start the session by declaring the global time variable t
(type declare t)
Our first function is P1:
New P1
jt 0 100
t=0
loop 10 [t=t+0.1 wrnum t]
The result is that 10 numbers from 0.1 to 1 will be displayed. For convenience we will always have the time t change from 0 to 1.
The next program is similar except that now 1000 numbers are displayed. This will allow smoother projections of movements on the screen that will be more pleasing to the senses.
New P1A
jt 0 100
t=0
loop 1000 [t=t+0.001 wrnum t]
jt -100 0
wrnum t
//Notice that t=t+0.001. This is not an accident since we ask that t is between 0 and 1.
The Next Program defines a function y where y=100*t (similar to y=100*x that you may be more familiar with)
New P2
local y
t=0
loop 1000 [t=t+0.001 y=100*t wrnum y]
JT -100 0
wrnum t
wrnum y
Next function is based on the Sin(x) function which you may heard about. We will explain it in detail in class: The actual function here is y=40*Sin(360*t) and it has a single period. This may seems strange at first but after a while will make sense.
NEW P3
local y
t=0
loop 100 [t=t+0.01 y=40*Sin(360*t)
fd y bk y gomv 1 0 wait 0.1]
The next program is just like the previous one but with 3 periods.
NEW P3A
local y
t=0
loop 100 [t=t+0.01 y=40*Sin(3*360*t)
fd y bk y gomv 1 0 wait 0.1]
The next program uses the definition of the Sin and Cos Functions to make a colored circle
NEW P3B
local x y
t=0
loop 100000 [t=t+0.00001
x=100*Cos(360*t)
y=100*Sin(360*t)
jt x y color rnd 512 [circle 8]]
The next two programs show what rich potential we have here. Next week we will learn about functions and colors. Once you start mastering the technique you become a Mathematical artist. Please be patient. It takes some time to get used to the new concepts but they are not difficult.
NEW P3C
local x y d
t=0
loop 100000 [t=t+0.00001
d=30*(Sin(360*3*t))^2
x=100*Cos(360*t)
y=100*Sin(360*t)
jt x y color rnd 511 [circle d]]
New P3D
local x y d r
t=0
loop 100000 [t=t+0.00001
d=30*(Sin(360*2*t))^2
r=60*(Sin(360*2*t))
x=r*Cos(360*t)
y=r*Sin(360*t)
jt x y color rnd 511 [circle d]]
Thursday, October 11, 2007
The Dalai Lama Visit
Please write what you learned and experienced from the Dalai Lama visit in Ithaca. Any thoughts?
Wednesday, October 10, 2007
Review problems and answers for test
I use this post to help you review for the test. You do not need to answer unless you want to.
The first comment has answers to the first set of questions and this link has review questions that we will go over on Thursday:
http://www.ithaca.edu/dani/classes/Mart/picture_puzzles/pictures_review/
Based on popular demand we added more pictures to play with. Have fun.... The first picture with the Ying and Yang is different then the rest and is like the flowers picture.
http://www.ithaca.edu/dani/classes/Mart/picture_puzzles/pictures_fun/
I was just sitting down to test out those SeeLogo pictures. I have gone through all of them already. They are very fun and relaxing to do in between doing homework. I was wondering if you could post more pictures on the blog as I am sure people will have gone through the ones already posted soon. I just think they are fun to think about and try to make so they don't have to be posted for just review purposes but for fun purposes! :)
The first comment has answers to the first set of questions and this link has review questions that we will go over on Thursday:
http://www.ithaca.edu/dani/classes/Mart/picture_puzzles/pictures_review/
Based on popular demand we added more pictures to play with. Have fun.... The first picture with the Ying and Yang is different then the rest and is like the flowers picture.
http://www.ithaca.edu/dani/classes/Mart/picture_puzzles/pictures_fun/
I was just sitting down to test out those SeeLogo pictures. I have gone through all of them already. They are very fun and relaxing to do in between doing homework. I was wondering if you could post more pictures on the blog as I am sure people will have gone through the ones already posted soon. I just think they are fun to think about and try to make so they don't have to be posted for just review purposes but for fun purposes! :)
Sunday, October 7, 2007
Answer to 9/30 (flowers) problem
Here are the answers to the 9/30/07 flowers problem
When we look at all three pictures we start seeing something in common. Look at them. Do you see that the second picture actually contains the first one and that the this picture actually contains the second? Look at them and see that this is true. This is the idea behind a "fractal": A mathematical object that contains itself within itself within itself....forever.
So how can we create this idea in SeeLogo? First let us prepare three names that will define the three pictures and we can call them A1 A2 and A3.
so we can type:
NEW A1
NEW A2
NEW A3
right now A1 A2 and A3 are empty. They have nothing in them but in few minutes we will fill in the void.
The first picture (A1) consists of a line and a circle "spun 6 times around the center"
step 1: Make a line and a circle
In the SeeLogo language there can be many ways to do it. (Click on A1 first)
For example we could type in the command line:
GOFD 40 FD 30 CIRCLE 60
JT 0 0
SPIN 6 IT
Or type directly in the editor:
SPIN 6 [FD 40 GOFD 30 CIRCLE 60 JT 0 0]
--------------------
The 2nd picture will be A2.
The idea now will be to do to steps almost like before:
Step 1: Make a line and a circle and fir A1 inside the circle using proportion.
Step 2: Bring the point back to the center and spin the picture 6 times.
We note that in order to fir the also picture A1 into the small circle we need to scale A1 to fit in it. Since the Diameter of the big picture A1 is 2*(40+60)=200 and the diameter of the small circle is 60 pixels, the scaling factor is exactly 60/200=30%
To make it in Seelogo we click on A2 we click on A2 first and then type:
FD 40 GOFD 30 CIRCLE 60 SIZE 60/200 [A1]
JT 0 0
SPIN 6 IT
-----------------
The next level will be same as level 2 except that you will use A2 instead of A1 and there is really not limit to the number of levels you can make. This process actually starts creating an infinite object: A fractal.
--------------------------------
Once you get the idea it you will feel some change in your brain but you cannot really force it. It has to happen naturally. This is why I do not judge you by your performance but by the effort you put into it and sometime to much pushing does not help. Still avoiding it does not help either. I suggest that you practice and I will give you a test in class (not on paper) to be able to [produce a similar picture. This will motivate you much more than a paper test and I think you will learn better. I will try to give you more examples later and/or in class to allow you to practice more but once you master it the benefit will carry much further than just this math class.
--Dani
1.
2.
3.
When we look at all three pictures we start seeing something in common. Look at them. Do you see that the second picture actually contains the first one and that the this picture actually contains the second? Look at them and see that this is true. This is the idea behind a "fractal": A mathematical object that contains itself within itself within itself....forever.
So how can we create this idea in SeeLogo? First let us prepare three names that will define the three pictures and we can call them A1 A2 and A3.
so we can type:
NEW A1
NEW A2
NEW A3
right now A1 A2 and A3 are empty. They have nothing in them but in few minutes we will fill in the void.
The first picture (A1) consists of a line and a circle "spun 6 times around the center"
step 1: Make a line and a circle
In the SeeLogo language there can be many ways to do it. (Click on A1 first)
For example we could type in the command line:
GOFD 40 FD 30 CIRCLE 60
JT 0 0
SPIN 6 IT
Or type directly in the editor:
SPIN 6 [FD 40 GOFD 30 CIRCLE 60 JT 0 0]
--------------------
The 2nd picture will be A2.
The idea now will be to do to steps almost like before:
Step 1: Make a line and a circle and fir A1 inside the circle using proportion.
Step 2: Bring the point back to the center and spin the picture 6 times.
We note that in order to fir the also picture A1 into the small circle we need to scale A1 to fit in it. Since the Diameter of the big picture A1 is 2*(40+60)=200 and the diameter of the small circle is 60 pixels, the scaling factor is exactly 60/200=30%
To make it in Seelogo we click on A2 we click on A2 first and then type:
FD 40 GOFD 30 CIRCLE 60 SIZE 60/200 [A1]
JT 0 0
SPIN 6 IT
-----------------
The next level will be same as level 2 except that you will use A2 instead of A1 and there is really not limit to the number of levels you can make. This process actually starts creating an infinite object: A fractal.
--------------------------------
Once you get the idea it you will feel some change in your brain but you cannot really force it. It has to happen naturally. This is why I do not judge you by your performance but by the effort you put into it and sometime to much pushing does not help. Still avoiding it does not help either. I suggest that you practice and I will give you a test in class (not on paper) to be able to [produce a similar picture. This will motivate you much more than a paper test and I think you will learn better. I will try to give you more examples later and/or in class to allow you to practice more but once you master it the benefit will carry much further than just this math class.
--Dani
1.
2.
3.
Monday, October 1, 2007
Subscribe to:
Posts (Atom)