m (→Sphere) |
(Added the cubic formula. It isn't something I've dealt with before, so if I've done something wrong then please correct it) |
||

Line 119: | Line 119: | ||

[[File:Cosine_Rule_Angles.gif]] | [[File:Cosine_Rule_Angles.gif]] | ||

+ | |||

+ | ==Cubic Formula== | ||

+ | {{note|This formula may deal with complex numbers that cannot be handled by Scratch, if it were to be worked out properly, the complex numbers would cancel out, but unfortunately here a lot of problems will be unsolvable due to the nature of Scratch.}} | ||

+ | |||

+ | This will give the answer to the equation: | ||

+ | |||

+ | [[File:Cubic function.png]] | ||

+ | |||

+ | The analogous formula for this is: | ||

+ | |||

+ | [[File:Cubic function 2.gif]] | ||

+ | |||

+ | In Scratch this translates to: | ||

+ | |||

+ | [[File:Cubic Root.gif|500px]] | ||

==Sine Rule== | ==Sine Rule== |

## Revision as of 12:33, 30 May 2012

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. |

## Contents

## Conventional measurement abbreviations

Abbreviation | Measurement |
---|---|

b | Length of a side of the base |

h | Height |

r | Radius |

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))))

### Cylinder

### Frustum

### Sector of a Circle

This will find the answer in degrees:

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

### Sphere

((pi)*((4)*((r)*((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 ((((s)*((s)-(A)))*((s)-(B)))*((s)-(C))))

## Cosine Rule

### For Sides

This will give an answer for side "c":

### For Angles

This will give an answer for angle "C":

## Cubic Formula

Note: | This formula may deal with complex numbers that cannot be handled by Scratch, if it were to be worked out properly, the complex numbers would cancel out, but unfortunately here a lot of problems will be unsolvable due to the nature of Scratch. |

This will give the answer to the equation:

The analogous formula for this is:

In Scratch this translates to:

## 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)))

## Quadratic Formula

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

## Volume

### Cone

### Cylinder

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

### Frustum

### Sphere

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

### Square-based Pyramid

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