# Random Vector/point/Position inside Sphere in Animation Nodes

Whats a good and performant way of creating a list of random vectors inside a given radius/sphere?

the random vector node (with scale set to 1) unfortunately creates vectors ranging from (-1, -1, -1) to (1, 1, 1), which results in a cube like shape. When changed to Normalized Vector, all vectors have a magnitude of exactly 1, resulting in uniform distribution on the surface of a sphere.

How can I achieve random vectors with a magnitude ranging from 0 to 1?

Is there a better way than creating a loop of a single normalized vector with a random scale?

• What about multiplying with .5 and adding 1 ? 😊 Jul 20 at 14:50
• I don't want vectors in the positive quadrant, I want vectors with a maximum but variable length. For example the vector (-1, -1, -1) has a length of 1.73 but i only want vectors in the range of 0 to 1. The Normalize Vector option in the node results in vectors of length 1 and exactly length 1. 😊 Jul 20 at 14:57

I use a Random Number inside a loop to control the scale of a single Random Vector node. The Random Vector is set to Normalized Vector. I also added a basic setup to have some control over the seeds.