Ruby's implementation of n-sphere