add midpoint function to Line