A general theory for robust clustering via trimmed mean