Finding the correct equation from given points