(Common Constants: italicized)
m (Conventional measurement abbreviations)
Line 32: Line 32:
 
<tr>
 
<tr>
 
<td>A, B, C</td>
 
<td>A, B, C</td>
<td>Angle measures of a triangle (angle a is opposite side A)</td>
+
<td>Angle measures of a triangle (angle A is opposite side a)</td>
 
</tr>
 
</tr>
 
</table>
 
</table>

Revision as of 19:13, 31 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 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
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.141592654

Area and Surface Area

Circle

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

Cone

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

Cylinder

File:Area of Cylinder.gif

Frustum

550px

Frustum 1.gif

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

Cosine Rule.png

For Sides

This will give an answer for side "c":

File:Cosine Rule Sides.gif

For Angles

This will give an answer for angle "C":

File:Cosine Rule Angles.gif

Cubic Formula

Note 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:

Cubic function.png

The analogous formula for this is:

Cubic function 2.gif

In Scratch this translates to:

500px

Sine Rule

Sine Rule.png

For Sides

This will give an answer for side "a":

File:Sine Rule Sides.gif

For Angles

This will give an answer for angle "A":

File:Sine Rule Angles.gif

Pythagorean theorem

Pythagorean theorem.png

This will give the length of the hypotenuse:

File:Pythagoras 1.gif

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

File:Pythagoras 2.gif

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

Quadratic.png

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

File:Quadratic.gif

Volume

Cone

File:Volume of a Cone.gif

Cylinder

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

Frustum

550px

Sphere

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

Square-based Pyramid

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