Calculates shapes