summaryrefslogtreecommitdiff
path: root/623/CH1/EX1.1.3/U1_C1_3.sce
blob: 0b729f72752149842bdbdc67c49e827c80bfbb08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//variable initialization
x=50,y=20,z=10                            //x,y,z cordinates in meters(frame s)
t=5*10^(-8);                             //time in seconds(frame s)
velocity=0.6*3*10^8;                     //velocity of observer in s' frame relative to s in meter/second
c=3*10^8;                                //speed of light in meter/second
Beta=0.6;
Gamma=1/((1-Beta^2)^(1/2));

//calculation of cordinates in s' frame
xdash=Gamma*(x-(velocity*t));             //value of x cordinate in frame s' in meters
ydash=y;                                  //value of y cordinate in frame s' in meters
zdash=z;                                  //value of z cordinate in frame s' in meters
tdash=Gamma*(t-((velocity*x)/(c^2)));     //value of t in frame s' in seconds

printf("\nValue of space time cordinates in frame s`:\n\t x`=%.2f meter\n\t y`=%.0f meter\n\t z`=%.0f meter\n\t t`=%.2e second",xdash,ydash,zdash,tdash);