Two applications of the integral geometry in affine and projective spaces