Skip to content

Commit 4b4fae5

Browse files
committed
PVector tutorial: fix typos and broken links (#464)
1 parent d8fc541 commit 4b4fae5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

content/tutorials/text/pvector/index.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ In the above example, we have a very simple world -- a blank canvas with a circu
7777

7878
- LOCATION: x and y
7979
- SPEED: xspeed and yspeed
80+
8081
In a more advanced sketch, we could imagine this ball and world having many more properties:
8182
- ACCELERATION: xacceleration and yacceleration
8283
- TARGET LOCATION: xtarget and ytarget
@@ -118,7 +119,7 @@ Here are some vectors and possible translations:
118119

119120
</FixedImage>
120121

121-
You've probably done this before when programming motion. For every frame of animation (i.e. single cycle through Processing's (http://processing.org/reference/draw_.html)draw()] loop), you instruct each object on the screen to move a certain number of pixels horizontally and a certain number of pixels (vertically).
122+
You've probably done this before when programming motion. For every frame of animation (i.e. single cycle through Processing's [draw()](http://processing.org/reference/draw_.html) loop), you instruct each object on the screen to move a certain number of pixels horizontally and a certain number of pixels (vertically).
122123

123124
For a Processing programmer, we can now understand a vector as the instructions for moving a shape from point A to point B, an object's &ldquo;pixel velocity&rdquo; so to speak.
124125

@@ -421,7 +422,7 @@ The fancy terminology and symbols aside, this is really quite a simple concept.
421422

422423
</HighlightBlock>
423424

424-
Moving onto multiplication, we have to think a little bit differently. When we talk about multiplying a vector what we usually mean is **_scaling_** a vector. Maybe we want a vector to be twice its size or one-third its size, etc. In this case, we are saying &ldquo;Multiply a vector by 2&rdquo; or &ldquo;Multiply a vector by 1/3&rquo;. Note we are multiplying a vector by a scalar, a single number, not another vector.
425+
Moving onto multiplication, we have to think a little bit differently. When we talk about multiplying a vector what we usually mean is **_scaling_** a vector. Maybe we want a vector to be twice its size or one-third its size, etc. In this case, we are saying &ldquo;Multiply a vector by 2&rdquo; or &ldquo;Multiply a vector by 1/3&rdquo;. Note we are multiplying a vector by a scalar, a single number, not another vector.
425426

426427
To scale a vector by a single number, we multiply each component (x and y) by that number.
427428

@@ -522,7 +523,9 @@ u.div(2);
522523
As with addition, basic algebraic rules of multiplication and division apply to vectors.
523524

524525
The associative rule: (n\*m)**\*v** = n\*(m**\*v**)
526+
525527
The distributive rule, 2 scalars, 1 vector: (n + m)**\*v** = n**\*v** + m**\*v**
528+
526529
The distributive rule, 2 vectors, 1 scalar : (**u** +**v**)\*n = n**\*u** + n**\*v**
527530

528531
</HighlightBlock>

0 commit comments

Comments
 (0)