Name

random3D()

Examples
v = PVector.random3D()
print(v)
# May print something like:
# [ 0.61554617, -0.51195765, 0.599168 ] or 
# [ -0.4695841, -0.14366731, -0.8711202 ] or 
# [ 0.6091097, -0.22805278, -0.7595902 ]
Description Returns a new 3D unit vector with a random direction. If you pass in this as an argument, it will use the PApplet's random number generator.
Syntax
.random3D()
.random3D(parent)
.random3D(target)
.random3D(target, parent)
Parameters
parentPApplet: current PApplet instance
targetPVector: the target vector (if null, a new vector will be created)
Related random2D()

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.