Multiplies a vector by a scalar and returns a new vector.
Examples
Syntax
mult(x, y, [z])
mult(arr)
mult(v)
mult()
mult(x, y, [z])
mult(v, n, [target])
mult(v0, v1, [target])
mult(v0, arr, [target])
Parameters
x
Number: number to multiply with the x component of the vector.
y
Number: number to multiply with the y component of the vector.
z
Number: number to multiply with the z component of the vector.
arr
Number[]: array to multiply with the components of the vector.
v
p5.Vector: vector to multiply with the components of the original vector.
n
Number:
target
p5.Vector: vector to receive the result.
v0
p5.Vector:
v1
p5.Vector:
Returns
p5.Vector: resulting new p5.Vector.
Notice any errors or typos? Please let us know. Please feel free to edit src/math/p5.Vector.js and open a pull request!
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.