Skip to content

Commit

Permalink
Merge pull request #366 from nature-of-code/notion-update-docs
Browse files Browse the repository at this point in the history
[Notion] Update docs
  • Loading branch information
shiffman authored Aug 2, 2023
2 parents 2f24627 + c57eb77 commit 5acf85f
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 91 deletions.
2 changes: 1 addition & 1 deletion content/02_forces.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ <h3 id="units-of-measurement">Units of Measurement</h3>
<h3 id="exercise-22">Exercise 2.2</h3>
<p>There’s another way you could write the <code>applyForce()</code> function, using the static method <code>div()</code> instead of <code>copy()</code>. Rewrite <code>applyForce()</code> using the static method. For help with this exercise, review static methods in <a href="/vectors#static-vs-non-static-methods">Chapter 1</a>.</p>
<pre class="codesplit" data-code-language="javascript">applyForce(force) {
let f = _______._______(_______,_______);
let f = <span class="blank">p5.Vector.div</span>(<span class="blank">force</span>, <span class="blank">this.mass</span>);
this.acceleration.add(f);
}</pre>
</div>
Expand Down
4 changes: 2 additions & 2 deletions content/03_oscillation.html
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ <h3 id="example-310-swinging-pendulum">Example 3.10: Swinging Pendulum</h3>

update() {
let gravity = 0.4;
//{!1 .code-wide} Formulafor angular acceleration
//{!1} Formula for angular acceleration
this.angleAcceleration = (-1 * gravity / this.r) * sin(this.angle);

//{!2} Standard angular motion algorithm
Expand All @@ -838,7 +838,7 @@ <h3 id="example-310-swinging-pendulum">Example 3.10: Swinging Pendulum</h3>
//{!1 .code-wide} The arm
line(this.pivot.x, this.pivot.y, this.bob.x, this.bob.y);
fill(127);
//{!1 .code-wide} The bob
//{!1} The bob
circle(this.bob.x, this.bob.y, this.ballr * 2);
}
}</pre>
Expand Down
178 changes: 92 additions & 86 deletions content/07_ca.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,29 @@
// http://natureofcode.com

let mover;
let counter=0;

function setup() {
createCanvas(640, 240);
mover = new Mover();
}

function draw() {
background(255);

mover.update();
mover.checkEdges();

counter++;
if(counter%3===0){
drawGraphic()
}
}

function drawGraphic(){
background(255,30);
mover.show();

}

function mousePressed(){
save('screenshot.png')
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5acf85f

Please sign in to comment.