diff --git a/p5/pmath/vector.py b/p5/pmath/vector.py index 32f1d4ee..8249906a 100644 --- a/p5/pmath/vector.py +++ b/p5/pmath/vector.py @@ -408,7 +408,7 @@ def from_angle(cls, angle): def random_2D(cls): """Return a random 2D unit vector. """ - x, y = np.random.random(2) + x, y = 2 * (np.random.random(2) - 0.5) vec = cls(x, y) vec.normalize() return vec