summaryrefslogtreecommitdiff
path: root/34/CH1/EX1.2/Ch1Exa2.sci
blob: 76b6120372e6161ad6651406e32880886ea003b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

fg= 5.6*(10^14); //frequency of green color, Hz
fr= 4.8*(10^14); //frequency of red color, Hz
c= 3*(10^8); //velocity of light, m/s
v= c*((fg^2 - fr^2)/(fg^2 + fr^2)); //longitudinal speed of observer, m/s
v= v*3.6; //convert to km/h
R= 1; //rate at which fine is to be imposed per km/h, $
l= 80; //speed limit upto which no fine is to be imposed, km/h
fine= v-l; // fine to be imposed,  $
disp(fine,"The fine imposed (in $) is: ")
 
//Result
// The fine imposed (in $) is:    
//  1.652D+08