Reflects a vector about a line in 2D or a plane in 3D.
The orientation of the line or plane is described by a normal vector that points away from the shape.
The static version of reflect(), as in p5.Vector.reflect(v, n), returns a new p5.Vector object and doesn't change the original.
Examples
Syntax
reflect(surfaceNormal)
reflect(incidentVector, surfaceNormal, [target])
Parameters
surfaceNormal
p5.Vector:
p5.Vector to reflect about.
incidentVector
p5.Vector:
vector to be reflected.
target
p5.Vector:
vector to receive the result.
This page is generated from the comments in src/math/p5.Vector.js . Please feel free to edit it and submit a pull request!