Skip to content
This repository has been archived by the owner on Jun 25, 2019. It is now read-only.

Commit

Permalink
more math fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shiffman committed Jul 1, 2016
1 parent 80340f9 commit b7459da
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chapters/03_oscillation.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ <h2>3.4 Pointing in the Direction of Movement</h2>

<p>OK. We know that the definition of tangent is:</p>

<div data-type="equation">{tangent}({angle}) = \frac{{velocity}_y}{{velocity}_x}</div>
<div data-type="equation">{tangent}({angle}) = \frac{velocity_x}{velocity_y}</div>

<p>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 <em>inverse tangent</em> comes in, sometimes referred to as <em>arctangent</em> or <em>tan<sup>-1</sup></em>. (There is also an <em>inverse sine</em> and an <em>inverse cosine</em>.)</p>

Expand Down
8 changes: 4 additions & 4 deletions chapters/06_steering.html
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,10 @@ <h2>6.7 The Dot Product</h2>

<p>The two formulas for dot product can be derived from one another with <a href="http://mathworld.wolfram.com/DotProduct.html">trigonometry</a>, but for our purposes we can be happy with operating on the assumption that:</p>

<div data-type="equation">\vec{A}\cdot\vec{B}=||\vec{A}||\times||\vec{B}||
<div data-type="equation">\vec{A}\cdot\vec{B}=||\vec{A}||\times||\vec{B}||</div>

<p><span data-type="equation">\vec{A}\cdot\vec{B} = ||\vec{A}||\times||\vec{B}||\times\cos(\theta)</span><br />
<span data-type="equation">\vec{A}\cdot\vec{B} = a_x\times b_x + a_y\times b_y</span></p>
<<p><span data-type="equation">\vec{A}\cdot\vec{B} = ||\vec{A}||\times||\vec{B}||\times\cos(\theta)</span><br />
<span data-type="equation">\vec{A}\cdot\vec{B}=a_x\times b_x + a_y\times b_y</span></p>

<p>both hold true and therefore:</p>

Expand Down Expand Up @@ -837,7 +837,7 @@ <h5>Exercise 6.9</h5>
<p>If two vectors (<span data-type="equation">\vec{A}</span> and <span data-type="equation">\vec{B}</span>) are orthogonal (i.e. perpendicular), the dot product (<span data-type="equation">\vec{A}\cdot\vec{B}</span>) is equal to 0.</p>
</li>
<li>
<p>If two vectors are unit vectors, then the dot product is simply equal to cosine of the angle between them, i.e. <span data-type="equation">\vec{A}\cdot\vec{B}\=\cos(\theta)</span> if <span data-type="equation">\vec{A}</span> and <span data-type="equation">\vec{B}</span> are of length 1.</p>
<p>If two vectors are unit vectors, then the dot product is simply equal to cosine of the angle between them, i.e. <span data-type="equation">\vec{A}\cdot\vec{B}=\cos(\theta)</span> if <span data-type="equation">\vec{A}</span> and <span data-type="equation">\vec{B}</span> are of length 1.</p>
</li>
</ol>
</section>
Expand Down
18 changes: 17 additions & 1 deletion magicbook.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b7459da

Please sign in to comment.