#Getting started with Vectors. We will be drawing heavily on Nature of Code. for the next part of the course. This week's material is all on pages 27-52.
Ensure you have done the Walker class exercises from last week. I.1, I.2 and I.3 (try some more examples in this chapter if you can)
This week's homework will be to begin with the concept of vectors.
##Vectors Watch the following videos, doing the examples in p5js as you go along. The video's are described using Processing but the concept of Vectors are universal. If you need to see the p5js example sketches they are here in this repository.
- 1.1 Vectors (The Nature of Code)
- 1.2 1.2 PVector class (The Nature of Code) Remember we are using p5js. So you will be using the p5js pVector class.. ATTENTION - I have also found that with this example, it will fail if you use the word 'location' as Shiffman does here and in the book. Use the word 'position' or similar instead. Javascript has many reserved words that are used in the language for different things, and so we cannot name variables after them. Location is one of these reserved words -it is used to describe window propoerties. See this example in code pen with the bouncing ball vector example using the word position.
Do exercises 1.1 and 1.2 from the book in p5js (you can do 1.3 if you are excited and familiar with 3D)
- 1.3 1.3 Vector Math (The Nature of Code)
- 1.4 1.4 Vector Math II (Nature of Code)
- 1.5 [1.5 Acceleration (The Nature of Code)] (https://www.youtube.com/watch?v=TQ_WZU5s_VA&list=PLRqwX-V7Uu6ZwSmtE13iJBcoI-r4y7iEc&index=5)
Do exercise 1.4 and 1.5 in p5js.
Still confused? Read through the book if you prefer, p27-52.