Linear function from two points