linear function through (2, 4) and (4, 10)