three point midpoint

changed formula and improved documentation