From 343bf4d09a8f8abda77bdf37e5aa6a822e97cd0b Mon Sep 17 00:00:00 2001 From: Aaron Date: Sun, 22 May 2011 19:18:15 -0700 Subject: [PATCH 1/2] Added my name to Authors textile. --- authors.textile | 1 + 1 file changed, 1 insertion(+) diff --git a/authors.textile b/authors.textile index 3e802f0..3e1310d 100644 --- a/authors.textile +++ b/authors.textile @@ -10,6 +10,7 @@ _The following people are totally rad and awesome because they have contributed * David Brady _ratgeyser@gmail.com_ * John Ford _jwford@gmail.com_ * Steven Reid _steven @ reidnorthwest . com_ +* Aaron Weinberger _aw9994@cs.ship.edu_ * ...You! What are you waiting for? Check out the contributing section and get cracking! From ca395d133cf5ba858439f6f84be8ba61e7572084 Mon Sep 17 00:00:00 2001 From: Aaron Date: Sun, 22 May 2011 23:18:29 -0400 Subject: [PATCH 2/2] Math Constants recipe added from Wanted-Recipes --- chapters/math/constants.textile | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 chapters/math/constants.textile diff --git a/chapters/math/constants.textile b/chapters/math/constants.textile new file mode 100644 index 0000000..18462ba --- /dev/null +++ b/chapters/math/constants.textile @@ -0,0 +1,49 @@ +--- +layout: recipe +title: Math Constants +chapter: Math +--- + +h2. Problem + +You need to use common mathematical constants like pi or e. + +h2. Solution + +Use Javascript's Math object to provide commonly needed mathematical constants. + +{% highlight coffeescript %} +Math.PI +# => 3.141592653589793 + +# Note: Capitalization matters! This produces no output, it's undefined. +Math.Pi +# => + +Math.E +# => 2.718281828459045 + +Math.SQRT2 +# => 1.4142135623730951 + +Math.SQRT1_2 +# => 0.7071067811865476 + +# Natural log of 2. ln(2) +Math.LN2 +# => 0.6931471805599453 + +Math.LN10 +# => 2.302585092994046 + +Math.LOG2E +# => 1.4426950408889634 + +Math.LOG10E +# => 0.4342944819032518 + +{% endhighlight %} + +h2. Discussion + +For another example of how a math constant is used in a real world problem, refer to the 'Converting Radians and Degrees' section of this Math chapter. \ No newline at end of file