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

#1 2010-03-20 01:03:33

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

How to put advanced math functions into Scratch

Side-note: I've been in math mood lately!
____________________________________________________________________________________
Complete Gamma function:
http://i39.tinypic.com/ajvu6q.gif

Raise to power:
10 ^ ( exponent * log( number ) )

I will add more when I find more ways to put advanced math functions into Scratch.

Last edited by ThePCKid (2010-03-24 19:53:31)

Offline

 

#2 2010-03-20 09:25:35

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: How to put advanced math functions into Scratch

Bump

Offline

 

#3 2010-03-20 10:36:39

Greenboi
Scratcher
Registered: 2010-01-30
Posts: 1000+

Re: How to put advanced math functions into Scratch

Nice script! *expeiriments*

Offline

 

#4 2010-03-20 11:04:36

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: How to put advanced math functions into Scratch

How about:
http://i41.tinypic.com/245ee6w.gif
(base and coefficient are both user-changeable)
If you want it done right.

Last edited by Greatdane (2010-03-20 11:05:18)


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#5 2010-03-20 11:56:28

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How to put advanced math functions into Scratch

Greatdane wrote:

How about:
http://i41.tinypic.com/245ee6w.gif
(base and coefficient are both user-changeable)
If you want it done right.

I'm confused, what is that, "^"?


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#6 2010-03-20 12:47:07

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: How to put advanced math functions into Scratch

juststickman wrote:

Greatdane wrote:

How about:
http://i41.tinypic.com/245ee6w.gif
(base and coefficient are both user-changeable)
If you want it done right.

I'm confused, what is that, "^"?

That script: raising to a power

Offline

 

#7 2010-03-20 15:12:39

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: How to put advanced math functions into Scratch

ThePCKid, give me credit. You didn't make it...


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#8 2010-03-20 15:40:34

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: How to put advanced math functions into Scratch

Why the HECK would you prefer THIS:
http://i41.tinypic.com/245ee6w.gif
over THIS (WHICH SUPPORTS NEGATIVE POWERS AND FRACTIONAL POWERS (ROOTS) )
10 ^ ( y * log(x) )
?!?!?!


nXIII

Offline

 

#9 2010-03-20 15:42:02

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: How to put advanced math functions into Scratch

BTW the gamma function will always return 0 >.>

Because the result starts at 0.

Last edited by nXIII (2010-03-20 15:42:27)


nXIII

Offline

 

#10 2010-03-24 19:54:01

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: How to put advanced math functions into Scratch

nXIII wrote:

BTW the gamma function will always return 0 >.>

Because the result starts at 0.

Oops...

fixed

Offline

 

#11 2010-03-25 06:19:58

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: How to put advanced math functions into Scratch

im a bit out of my depth at the moment, what do all these things do?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#12 2010-03-25 12:06:09

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How to put advanced math functions into Scratch

markyparky56 wrote:

im a bit out of my depth at the moment, what do all these things do?

Well the (10^ (log ( )) is raisin to the power of...
The rest I haven't learned yet.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#13 2010-03-25 12:29:50

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: How to put advanced math functions into Scratch

juststickman wrote:

markyparky56 wrote:

im a bit out of my depth at the moment, what do all these things do?

Well the (10^ (log ( ) ) is raisin to the power of...
The rest I haven't learned yet.

there is no ( () ^ () ) blocks in scratch though...

Last edited by markyparky56 (2010-03-25 12:30:02)


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#14 2010-03-25 13:56:55

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How to put advanced math functions into Scratch

markyparky56 wrote:

juststickman wrote:

markyparky56 wrote:

im a bit out of my depth at the moment, what do all these things do?

Well the (10^ (log ( ) ) is raisin to the power of...
The rest I haven't learned yet.

there is no ( () ^ () ) blocks in scratch though...

That is why we have to use 10^ log


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#15 2010-03-25 14:22:38

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: How to put advanced math functions into Scratch

markyparky56 wrote:

im a bit out of my depth at the moment, what do all these things do?

OK, the log function is very interesting because it basically reduces operations to a lower level (multiplication becomes addition and powers become multiplication). We're basically reducing the x^y to 10^(log(x) * y). See the similarity? The number goes in the log and the power stays outside but is reduced to multiplication. We use '10^( )' because log returns a value (let's call it x) that makes this true: 10^(log(x) ) = x because it is the base 10 logarithm.

Sorry if I messed up somewhere...

Last edited by nXIII (2010-03-25 14:23:27)


nXIII

Offline

 

#16 2010-03-26 00:16:22

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

Re: How to put advanced math functions into Scratch

ThePCKid wrote:

Side-note: I've been in math mood lately!
____________________________________________________________________________________
Complete Gamma function:
http://i39.tinypic.com/ajvu6q.gif

Raise to power:
10 ^ ( exponent * log( number ) )

I will add more when I find more ways to put advanced math functions into Scratch.

Neat!
You can see the exponentials in action in this project, if anyone is confused.


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

#17 2010-03-26 08:08:39

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: How to put advanced math functions into Scratch

nXIII wrote:

markyparky56 wrote:

im a bit out of my depth at the moment, what do all these things do?

OK, the log function is very interesting because it basically reduces operations to a lower level (multiplication becomes addition and powers become multiplication). We're basically reducing the x^y to 10^(log(x) * y). See the similarity? The number goes in the log and the power stays outside but is reduced to multiplication. We use '10^( )' because log returns a value (let's call it x) that makes this true: 10^(log(x) ) = x because it is the base 10 logarithm.

Sorry if I messed up somewhere...

So
But there is no ^ part, o how do you get that in scratch? Do you do

(x)*(Log( (X*Y) ) ?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#18 2010-03-26 12:52:33

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: How to put advanced math functions into Scratch

markyparky56 wrote:

nXIII wrote:

markyparky56 wrote:

im a bit out of my depth at the moment, what do all these things do?

OK, the log function is very interesting because it basically reduces operations to a lower level (multiplication becomes addition and powers become multiplication). We're basically reducing the x^y to 10^(log(x) * y). See the similarity? The number goes in the log and the power stays outside but is reduced to multiplication. We use '10^( )' because log returns a value (let's call it x) that makes this true: 10^(log(x) ) = x because it is the base 10 logarithm.

Sorry if I messed up somewhere...

So
But there is no ^ part, o how do you get that in scratch? Do you do

(x)*(Log( (X*Y) ) ?

Ok, sorry, iv found out you do it now.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

Board footer