the distance of a point from nD-subspace

45 Views Asked by At

I have nD-subspace in R^m,(m>n). and I want to find the distance between a point in R^m and this subspace. I think I can consider this point as a vector, starting from the origin and find projection vector on this subspace and then subtract the projection vector from the vector and find the length of this vector. but it is not correct, is anybody can tell me what i have to do and why my solution does not work?