y = (x-2)/4 is the line for the points (-10,-3), (10,2) Just take the change -10 -> -3 and 10 -> 2 for the cos x, that is cos((x-2)/4) is the function for plotting. so you plot2d sin(x) and cos((x-2)/4)