Skip to content

Commit

Permalink
Merge pull request #594 from nature-of-code/notion-update-docs
Browse files Browse the repository at this point in the history
Another attempt to add callout for quote source and removing italics
  • Loading branch information
tuantinghuang authored Dec 9, 2023
2 parents e27ef1e + 55dbc20 commit 77e487c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/02_forces.html
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ <h3 id="gravitational-attraction">Gravitational Attraction</h3>
<figcaption>Figure 2.7: An acceleration vector pointing toward the mouse position</figcaption>
</figure>
</div>
<p>Remember in <a href="/vectors#algorithm-3-interactive-motion">Chapter 1</a>, when I created an object accelerating toward the mouse (see Figure 2.7)? As I showed then, a vector can be thought of as the difference between two points, so to calculate a vector pointing from the circle to the mouse, I subtracted one point from another:</p>
<p>Remember in Chapter 1, when I created an object accelerating toward the mouse (see Figure 2.7)? As I showed then, a vector can be thought of as the difference between two points, so to calculate a vector pointing from the circle to the mouse, I subtracted one point from another:</p>
<pre class="codesplit" data-code-language="javascript">let direction = p5.Vector.sub(mouse, position);</pre>
<p>Now I can do the same thing to calculate <span data-type="equation">\hat{r}</span>. The direction of the attraction force that object 1 exerts on object 2 is equal to the following:</p>
<pre class="codesplit" data-code-language="javascript">let direction = p5.Vector.sub(position1, position2);
Expand Down

0 comments on commit 77e487c

Please sign in to comment.