summaryrefslogtreecommitdiff
path: root/1985/CH3/EX3.1/Chapter3_Example1.sce
diff options
context:
space:
mode:
Diffstat (limited to '1985/CH3/EX3.1/Chapter3_Example1.sce')
-rwxr-xr-x1985/CH3/EX3.1/Chapter3_Example1.sce14
1 files changed, 14 insertions, 0 deletions
diff --git a/1985/CH3/EX3.1/Chapter3_Example1.sce b/1985/CH3/EX3.1/Chapter3_Example1.sce
new file mode 100755
index 000000000..48f1104a9
--- /dev/null
+++ b/1985/CH3/EX3.1/Chapter3_Example1.sce
@@ -0,0 +1,14 @@
+
+clc
+clear
+
+//INPUT DATA
+u=3.5*10^2;//Speed of the cyclist in m/s
+v=2*10^3;//Speed of the train in m/s
+c=3*10^8;//Speed of light in m/s
+
+//CALCULATIONS
+U=((u+v)/(1+((u*v)/c^2)))/1000//Relative speed in km/s
+
+//OUTPUT
+mprintf('The relative speed is %3.2f*10^3 m/s',U)