//Example 2.2 //See Figure 2.18 //Part a - motion towards right x_0=4.70;//Initial position (km) x_f=6.70;//Final position (km) delta_x=x_f-x_0;//Displacement (km) printf('Displacement in part (a) = %0.2f km',delta_x) //Part b - motion towards left x_0_prime=5.25;//Initial position (km) x_f_prime=3.75;//Final position (km) delta_x_prime=x_f_prime-x_0_prime;//Displacement (km) printf('\nDisplacement in part (b) = %0.2f km',delta_x_prime) //Openstax - College Physics //Download for free at http://cnx.org/content/col11406/latest