//Example 28.2 L_0=4.3;//Distance between the Earth and Alpha Centauri as measured by an Earth-bound observer (ly) Gamma=30; L=L_0/Gamma;//Distance as measured by astronaut (ly) printf('a.Distance between Earth and Alpha Centauri as measured by the astronaut = %0.4f ly',L) //Rearranging Equation 28.24 and multiplying by (c/c) to get velocity in terms of c v=sqrt((30^2-1)/30^2);//Velocity (in terms of c) printf('\nb.Velocity of the astronaut relative to the Earth = %0.4fc',v) //Openstax - College Physics //Download for free at http://cnx.org/content/col11406/latest