Performs modulo (remainder) division with a vector's components.
rem() can use separate numbers, as in v.rem(1, 2, 3), another p5.Vector object, as in v.rem(v2), or an array of numbers, as in v.rem([1, 2, 3]).
If only one value is provided, as in v.rem(2), then all the components will be set to their values modulo 2. Calling rem() with no arguments, as in v.rem(), has no effect.
You should modulo vectors only when they are the same size. When two vectors of different sizes are used, the smaller dimension will be used, any additional values of the longer vector will be ignored. For example, taking [3, 6, 9] modulo [2, 4] will result in [1, 2].
The static version of rem(), as in p5.Vector.rem(v2, v1), returns a new p5.Vector object and doesn't change the originals.
Examples
Syntax
rem(x, y, z)
rem(value)