def r(w, Xs):
n = len(Xs)<EOL>P = projection_matrix(w)<EOL>c = C(w, Xs)<EOL>return np.sqrt(sum(np.dot(c - X, np.dot(P, c - X)) for X in Xs) / n)<EOL>
Calculate the radius given the cylinder direction and a list
    of data points.