Performs modulo (remainder) division with a vector's x
, y
, and z
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. If two values are provided, as in v.rem(2, 3)
, then v.z
won't change. Calling rem()
with no arguments, as in v.rem()
, has no effect.
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)
rem(v1, v2)
rem(v1, v2)
Parameters
Returns
Related References
textToContours
Returns an array of arrays of points outlining a string of text written using the font.
textToModel
Converts text into a 3D model that can be rendered in WebGL mode.
textToPaths
Returns a flat array of path commands that describe the outlines of a string of text.
textToPoints
Returns an array of points outlining a string of text written using the font.