This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2007-05-20 17:59:19

Avram_Tetewsky
Scratcher
Registered: 2007-05-20
Posts: 3

Using Scratch for Middle and High School Math

If Scratch has some math librarires such as normal math functions found in
C, that would make it really neat to teach math to kids in middle and high school
because kids want to see how video games are written, and you can write simple games in Scratch like pong and shooter games, and having a bit of these libraries would let us do parabilic motion and gravity etc...

ALso, if i knew the frames per second this paints at, i could show kids how to scale a game where a ball goes 5 feet/sec say into how many pixels a second, so we can teach dimensional analysis


I occassionaly volunteer to give lectures at the schools based on what a teacher needs, such as showing how to do dimensional analysis using music compression equations, etc..,
or what ever they need.

example:
if the screen updates 30 frames per second, and you want to move 400 pixels in 1 minute,
so the increment per frame (the number to move by) would be:

(400 pixels/60 seconds) x (1 second/30 frames ) = ___ incremetn in pixels/frame

so the magic number to put in the move by command would be calculated above.

Having an idea of how the program executes the loops at what rates would allow us to demonstrate how to calculate the correct numbers using dimensional analysis.

Having more of math library would mean we could bring geometry and algebra into the lesson using scratch as the hook to get them interested.

Offline

 

#2 2007-05-20 20:28:56

Canthiar
Scratcher
Registered: 2007-05-16
Posts: 100+

Re: Using Scratch for Middle and High School Math

High school is a great time to learn about the Taylor series. 

Kidding aside, some trig functions would be really nice.  If there was a way to read colors from the background into a variable you could create a lookup table for various functions.

The frame rate doesn't seem to always be consistent based on how complicated the program is.  You could always use the timer variable to calculate framerate or have the kids use variable frame rates.

Offline

 

#3 2007-05-21 06:50:05

Avram_Tetewsky
Scratcher
Registered: 2007-05-20
Posts: 3

Re: Using Scratch for Middle and High School Math

Do you have any idea about the approxmiate real time metaphor scratch uses,
you seem to be an advanced java user reading your comments.
Also, how do you print out the the code listings?

Offline

 

#4 2007-05-21 06:51:13

Avram_Tetewsky
Scratcher
Registered: 2007-05-20
Posts: 3

Re: Using Scratch for Middle and High School Math

how did you measure the frame rate, and do you have any documentation on the approximate inside model used by Scratch?

Offline

 

#5 2007-05-21 09:00:37

Canthiar
Scratcher
Registered: 2007-05-16
Posts: 100+

Re: Using Scratch for Middle and High School Math

I've uploaded an example for calculating delta time here http://scratch.mit.edu/projects/Canthiar/5538  Scratch is multi-threaded so you may want to use broadcast and wait commands to sync up with other time critical scripts.

I don't have any more documentation than what is available on the website.  To get the source code I just downloaded the jar file and used http://www.kpdus.com/jad.html to decompile the source.  Looking at decompiled code only gives so much insight since there are no comments, local variables aren't named correctly, and named constants are removed from the code.

Disclaimer: I don't condone code theft using using tools like Jad.

Offline

 

#6 2007-05-21 13:25:43

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Using Scratch for Middle and High School Math

Physics-like simulation (with scaling) is certainly possible in scratch, though trig functions *would* be nice for a lot of applications.

See, for example, my son's 5th-grade science fair project
http://www.soe.ucsc.edu/~karplus/scratch_programs/index.html#BouncingBall

Offline

 

#7 2007-05-22 18:32:02

Canthiar
Scratcher
Registered: 2007-05-16
Posts: 100+

Re: Using Scratch for Middle and High School Math

Kevin, that looks like some advanced stuff for a 5th grader to know.  That's pretty impressive if he actually understands everything that is going on in his program.  I'm guessing he didn't learn about it at a public school.

Avram, you may want to decide if you want to go with a variable or fixed delta time.  Euler integration seems to be fine for fixed delta times, but all of the cool kids these days are using Verlet integration for their physics simulations since its more stable with variable delta times.  That could be a more advanced topic if you want to get into it.

The demo Kevin pointed out and the ones that I've made seem to look fairly smooth with a fixed delta time, but it could just be the machine that I'm running these demos on.  Unless you're doing real simulations most people are just going to mess around the velocities until they get something that looks good, anyway.

Offline

 

#8 2007-05-22 23:53:01

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Using Scratch for Middle and High School Math

Yeah, it was pretty advanced stuff.  He had to learn some calculus in order to figure out the height the ball would bounce to.  (Actually, we did the derivation together while walking downtown---it was pretty amazing to see him doing the math in his head, learning the physics and calculus at the same time.  I didn't tell him it was calculus though, until after he had finished writing up the derivation.)  Lately he's been reading "Calculus for Dummies" as light reading.

My son's simulations were real, in that he tried to get all the constants right.
He had a lot of fun making the scalable grid for the background.  Trivial in most plotting programs, but labeling the grid was tricky in scratch.

Offline

 

Board footer