summaryrefslogtreecommitdiff
path: root/3850/CH47/EX47.1/Ex47_1.sce
blob: d5a1a154b20b76b9b855b36abfd8eafcf45f7d4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

//To Calculate the time for which the Person slept according to clocks

//Example 47.1

clear;

clc;

delt=6;//Duration of Sleep according to person's watch

v=3*10^7;//Speed of the train(in which the person is sitting) in m/s

c=3*10^8;//Speed of light in m/s

delt1=delt/sqrt(1-(v/c)^2);//Duration of sleep in the ground frame

delt1h=int(delt/sqrt(1-(v/c)^2));//Duration of sleep (in whole number of hours) in the ground frame

printf("Duration of sleep according to the clocks = %.0f hours ",delt1h);

delt1m=(delt1-delt1h)*60;//Duration of sleep (in remaining ) in the ground frame

printf("%.1f minutes",delt1m);