Right triangles and formulas