Constrained Principal Component Analysis on some Gramian Matrices