From 84fa08a4a052d7cab6d82a6d6a3164041708e96e Mon Sep 17 00:00:00 2001 From: shiffman Date: Tue, 27 Feb 2024 15:17:15 +0000 Subject: [PATCH] Notion - Update docs --- content/01_vectors.html | 3 --- content/06_libraries.html | 1 - 2 files changed, 4 deletions(-) diff --git a/content/01_vectors.html b/content/01_vectors.html index 8aa7d24..50571fa 100644 --- a/content/01_vectors.html +++ b/content/01_vectors.html @@ -918,18 +918,15 @@ position.add(velocity);

Setting aside vectors for a second, take a look at the following code:

let x = 0;
 let y = 5;
-
 x = x + y;

This is probably what you’re used to, yes? I give x a value of 0, add y to it, and now x is equal to 5. I could write similar code for adding two vectors:

let v = createVector(0, 0);
 let u = createVector(4, 5);
-
 v.add(u);

The vector v has the value of (0, 0), I add the vector u to it, and now v is equal to (4, 5). Makes sense, right?

Now consider this example:

let x = 0;
 let y = 5;
-
 let z = x + y;

I give x a value of 0, add y to it, and store the result in a new variable z. The value of x doesn’t change here (neither does y)! This may seem like a trivial point, and one that’s quite intuitive when it comes to mathematical operations with simple numbers. However, it’s not so obvious with mathematical operations using p5.Vector objects. Let’s try to rewrite the example with vectors, based on what I’ve covered of the p5.Vector class so far:

let v = createVector(0, 0);
diff --git a/content/06_libraries.html b/content/06_libraries.html
index cf5fc96..8ce09d9 100644
--- a/content/06_libraries.html
+++ b/content/06_libraries.html
@@ -295,7 +295,6 @@ let ball = Bodies.circle(<
 
// Store the canvas in a variable.
 let canvas = createCanvas(640, 360);
-
 // Configure the renderer.
 let params = {
   canvas: canvas.elt,