...
Multiplication only effects the magnitude of the vector, leaving the direction unchanged... However, if the vector is multiplied by a negative, then the direction is reversed and the magnitude is unchanged.
(Diagram 45. vector multiplication)
(Diagram 56. vector negative multiplication)
Subtraction
Subtracting two vectors
Finding the magnitude
You can find the magnitude (the length) with this formula. You might notice that this is the same formula for finding the length between two points.Pythagorean formula:
(Diagram 67. sqrt(x^2 + y^2))
PVector
Processing has a vector class called ‘PVector‘, which can be two or three dimensions.
...