powered by
num_dims
Get a random unit vector with num_dims components.
rand_unit_vector(num_dims)
A random unit vector with num_dims components.
Number of components in vector (i.e. vector size).
r <- rand_unit_vector(4) norm(r, "2")
Run the code above in your browser using DataLab