Pi - popularly shortened to 3.14159 - is the circumference - that is, the outside perimeter - of a circle with diameter 1. For circles with a diameter greater or less than 1, we typically use the formula 2 × pi × r (The radius being exactly half the diameter, or the distance between the center of the circle and the perimeter).
While it’s most common application is finding the circumference and area of circles, pi is also used in probability, statistics, engineering and science: as a universal constant, it shows up everywhere.
1.4142135623730951. (Due to rounding errors,
Math.SQRT2 * Math.SQRT2 is not exactly 2).
The square root of 0.5, equivalent to 1 divided by the square root of 2. Again, an irrational number.
e is the base rate of growth, a constant shared by every continually growing processes; compound interest, population growth, radioactive decay, and more. Examples of these processes are everywhere. Things grow at different rates over time, but they all share a commonality with
e, which can be used as a “growth factor” in calculations. For example, a cell in a human embryo that divides and doubles continuously. In the console:
Math.pow(Math.E,1) > 2.718281828459045 Math.pow(Math.E,2) > 7.3890560989306495 Math.pow(Math.E,3) > 20.085536923187664
The “natural” log is the inverse of
e^x: rather than providing the amount of growth, the natural log (and its relations) provide the time needed to reach a certain level of growth.
Math.log(x) provides the base
e of a given number (
x), but there are several built-in constants:
The natural logarithm of 10: rounded to 2.302585092994046
The base-2 logarithm of e. Rounded to 1.4426950408889634
The base-10 logarithm of e. Rounded to 0.4342944819032518
Photograph by Petra van der Ree, used under a Creative Commons license
Enjoy this piece? I invite you to follow me at twitter.com/dudleystorey to learn more.