Formulas and functions of shapes