This page lists ways in which important mathematical functions and formulas can be expressed using the Scratch Operators Blocks (in alphabetical order). Note: Since pi is an irrational number, it is up to the user to decide the number of decimal places it is rounded to. 3.14 is the conventional rounding.

## Conventional measurement abbreviations

Abbreviation Measurement
b Length of a side of the base
h Height
l Slant Height
A, B, C Side lengths of a triangle
a, b, c Angle measures of a triangle (angle a is opposite side A)

### Common Constants

Constant Approximate Value
pi (π) 3.141592653

## Area and Surface Area

### Circle

```((pi) * ((r) * (r)))
```

### Cone

```(((pi) * ((r) * (r))) + ((pi) * ((r) * (l))))
```

### Sector of a Circle

This will find the answer in degrees:

```(((central angle)/(360))*((pi)*((r)*(r))))
```

### Sphere

`((pi)*((4)*((r)*((r)))))`

### Square-based Pyramid

```(((2)*((b)*(l)))+((b)*(l)))
```

### Trapezoid/Trapezium

Here, "a" and "b" are the two parallel sides of the trapezoid.

`((((a)+(b))*(h))/(2))`

### Triangle

There are numerous ways to calculate the area of a triangle:

2 known side lengths (a and b) and 1 known angle between the sides (C):

```(((a)*(b)) * (([sin v] of (C)) * (2)))
```

Two known angles (A and B) and one known side length between the two angles (c):

```((((c)*(c))*(([sin v] of (A))*([sin v] of (B))))  / ((-2)*([sin v] of ((A)+(B)))))
```

3 known side lengths (A, B, C), also called Heron's formula:

```set [s v] to ((((A)+(B))+(C))/(2))//s is called the semiperimeter
set [area v] to ([sqrt v] of ((((l)*((l)-(A)))*((l)-(B)))*((l)-(C))))
```

## Cosine Rule

### For Sides

This will give an answer for side "c":

### For Angles

This will give an answer for angle "C":

## Sine Rule

### For Sides

This will give an answer for side "a":

### For Angles

This will give an answer for angle "A":

## Pythagorean theorem

This will give the length of the hypotenuse:

And these will give the length of sides "a" and "b" (assuming the hypotenuse is "c"):

### Distance between two points

```set [a v] to (((x1)-(x2))*((x1)-(x2)))
set [b v] to (((x1)-(x2))*((x1)-(x2)))
set [dist v] to ([sqrt v] of ((a)+(b)))
```

These will give the two possible answers of "x":

## Volume

### Cylinder

`((pi)*((r)*((r)*(h))))`

### Sphere

```(((4)/(3))*((pi) * ((r)*((r)*((r)*(r))))))
```

### Square-based Pyramid

```((((b)*(b))*(h))/(3))
```