# shiffman/The-Nature-of-Code

more math fixes

1 parent 80340f9 commit b7459da1be01f7d9ba6e443bb211a048d38453b7 committed Jul 1, 2016
Showing with 22 additions and 6 deletions.
1. +1 −1 chapters/03_oscillation.html
2. +4 −4 chapters/06_steering.html
3. +17 −1 magicbook.json
 @@ -294,7 +294,7 @@

OK. We know that the definition of tangent is:

-
{tangent}({angle}) = \frac{{velocity}_y}{{velocity}_x}
+
{tangent}({angle}) = \frac{velocity_x}{velocity_y}

The problem with the above is that we know velocity, but we don’t know the angle. We have to solve for the angle. This is where a special function known as inverse tangent comes in, sometimes referred to as arctangent or tan-1. (There is also an inverse sine and an inverse cosine.)

 @@ -760,10 +760,10 @@

The two formulas for dot product can be derived from one another with trigonometry, but for our purposes we can be happy with operating on the assumption that:

-
\vec{A}\cdot\vec{B}=||\vec{A}||\times||\vec{B}|| +
\vec{A}\cdot\vec{B}=||\vec{A}||\times||\vec{B}||
-

\vec{A}\cdot\vec{B} = ||\vec{A}||\times||\vec{B}||\times\cos(\theta)
-\vec{A}\cdot\vec{B} = a_x\times b_x + a_y\times b_y

+<

\vec{A}\cdot\vec{B} = ||\vec{A}||\times||\vec{B}||\times\cos(\theta)
+\vec{A}\cdot\vec{B}=a_x\times b_x + a_y\times b_y

both hold true and therefore:

@@ -837,7 +837,7 @@

If two vectors (\vec{A} and \vec{B}) are orthogonal (i.e. perpendicular), the dot product (\vec{A}\cdot\vec{B}) is equal to 0.

• -

If two vectors are unit vectors, then the dot product is simply equal to cosine of the angle between them, i.e. \vec{A}\cdot\vec{B}\=\cos(\theta) if \vec{A} and \vec{B} are of length 1.

+

If two vectors are unit vectors, then the dot product is simply equal to cosine of the angle between them, i.e. \vec{A}\cdot\vec{B}=\cos(\theta) if \vec{A} and \vec{B} are of length 1.

•  @@ -2,7 +2,23 @@ "title":"The Nature of Code", "destination":"build/:build", "files":[ - "chapters/test.html" + "chapters/00_1_titlepage.html", + "chapters/00_2_dedication.html", + "chapters/00_3_creditscopyright.html", + "chapters/00_5_preface.html", + "chapters/00_6_TOC.html", + "chapters/00_7_intro.html", + "chapters/01_vectors.html", + "chapters/02_forces.html", + "chapters/03_oscillation.html", + "chapters/04_particles.html", + "chapters/05_physicslib.html", + "chapters/06_steering.html", + "chapters/07_ca.html", + "chapters/08_fractals.html", + "chapters/09_ga.html", + "chapters/10_nn.html", + "chapters/xx_1_furtherreading.html" ], "addPlugins":[ "magicbook-codesplit",