So I want to create a random point in a m-dimensional space (with m>2) that is k units away from the origin.
My first guess was to randomly draw m-1 angels (from a uniform distribution from 0 to 2pi) and then use the cosine of each of these angels times the length k, such that I get the projection onto each of the axes and thus the coordinate in that specific direction (cartesian coordinates). The last coordinate I would determine by using the euclidean distance namely k^2 minus the sum of the (m-1) squared cartesian coordinates.
However, doing this can cause the k^2 to be smaller than the sum of all the m-1 coordinates squared and thus ending up with a complex number when taking the square root.
So what is the correct way to drawing random points that are exactly k units away from the origin?