determine slope from a graph