Vectors

When trying to simulate any real world object forces in the form of vectors will be used to give properties, similar to its real world equivalent. Vectors create the forces part of any real word simulation of objects. Vectors are what are used to send a object moving using a direction and a magnitude. A vector is worked out by how you get from the tail to the head. The image below shows the vector (2,3) as have to move 2 on x and 3 on y. Vectors can be added, subtracted and multiplied together when new forces interact with an object.

vector

Vectors are used in real world simulations to replicate forces applied by machines, humans and gravity to make objects react in similar ways in which they would in the physical world. The best way to show vectors working is a ball dropping in a space as It would have several forces working including weight (gravity), air resistance and reaction forces from impacting with the ground.

Processing has class tool called PVector  This allows vectors to be inputted into a sketch in 2d & 3d with lots of method preference available to use with the class such as get(), add(), sub() for some examples. There is also methods to do calculations like distance between vector points and angles at which they are traveling.

Here is an example of a ball bouncing with the necessary forces applied…

Leave a Reply