Projectively invariant distances for affine and projective structures