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

#1 2011-12-18 11:12:03

LewisZapata-Lee
New Scratcher
Registered: 2011-11-30
Posts: 45

functions

In the operators section, there is a block with different functions in it.  You can find the [function] of any value you type in.  The problem is, I don't know what these functions are.  If you know what they are, please define the following functions for me:
abs;
sqrt;
sin;
cos;
tan;
asin;
acos;
atan;
ln/in*;
log;
e^;
10^.

*ln/in is not the function.  It is either ln or in.  I couldn't tell.

Offline

 

#2 2011-12-18 11:45:15

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: functions

abs: absolute value.  Reports the positive version of the input.  (-1 -> 1, 1 -> 1).

sqrt:  square root.  Reports the number that, squared (times itself), would equal the input.  (sqrt 81 = 9, because 9 * 9 = 81).

sin, cos, tan, asin, acos, atan, and ln: These are trignometric functions (very complicated).

e^:  Reports the constant e raised to the input.  If you don't know what e is, you'll never need to use this block.  Like trigonometry, very complicated.   smile

10^:  Reports 10 raised to the input.
10^-2 = 0.01
10^-1 = 0.1
10^0 = 1
10^1 = 10
10^2 = 100

Offline

 

#3 2011-12-18 12:21:51

LewisZapata-Lee
New Scratcher
Registered: 2011-11-30
Posts: 45

Re: functions

Thank you for the help.  I'm sure this will come in very handy.

P.S: if anyone else wants to go into more detail, please do.

Offline

 

#4 2011-12-18 12:38:14

marcsteene
Scratcher
Registered: 2007-08-24
Posts: 48

Re: functions

Greenatic explained the abs and sqrt functions well enough. Here's a description of the others.

Sin, cosine, and tan are trigonometric functions. Sin and Cosine go from -1 to 1. It's a ratio of the different sides of triangles. Arcsin, arccos, and arctan are the inverse functions of sin cos and tan and are used to get the angle back from a ratio. You can use these in Scratch in physics simulators to work out the different components of vector quantities, such as the motion of a cannonball.

To understand the ln function, you need to understand what e is first. e is a constant, and the graph of f(x)=e^x is very unique, because the gradient at any point of the graph is always equal to the value that of f(x). It's very useful for modelling exponential change in physics.

Ln is the natural logarithm, say you have ln(X)=5, it means that the constant e raised to the power of 5 is equal to X. Log is the same as ln except it can use any base, not just e. I think in Scratch you can only use log base 10. It means if you have log5=X, it means 10^X=5, so you can use it to work out the power that number must be raised to to achieve the final value.

10^ is called standard form, it's useful for displaying very large numbers in a small space. For example, 1,000,000 would be 1.0x10^6.

Hope this helps  smile

sin;
cos;
tan;
asin;
acos;
atan;
ln/in*;
log;
e^;
10^.

Last edited by marcsteene (2011-12-18 12:39:08)

Offline

 

#5 2011-12-20 17:15:03

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: functions

The wiki page about that block might help you.  smile


http://i48.tinypic.com/2z5pqad.png

Offline

 

#6 2011-12-20 17:32:45

mcpNOVA
Scratcher
Registered: 2011-12-05
Posts: 100+

Re: functions

I was just thinking the same thing! The posts above helped me though.


http://i43.tinypic.com/n5fqcz.jpg

Offline

 

#7 2011-12-29 09:17:16

LewisZapata-Lee
New Scratcher
Registered: 2011-11-30
Posts: 45

Re: functions

Thank you for the link, it was very helpful.

Offline

 

Board footer