Computations on the grassmann manifold and affine-permutation invariance in shape representation