summaryrefslogtreecommitdiff
path: root/3717/CH1/EX1.2/Ex1_2.sce
diff options
context:
space:
mode:
Diffstat (limited to '3717/CH1/EX1.2/Ex1_2.sce')
-rw-r--r--3717/CH1/EX1.2/Ex1_2.sce15
1 files changed, 15 insertions, 0 deletions
diff --git a/3717/CH1/EX1.2/Ex1_2.sce b/3717/CH1/EX1.2/Ex1_2.sce
new file mode 100644
index 000000000..472bedba2
--- /dev/null
+++ b/3717/CH1/EX1.2/Ex1_2.sce
@@ -0,0 +1,15 @@
+// Ex1_2: Page:10 (2014)
+clc; clear;
+c = 1; // For simplicity assume speed of light to be unity, m/s
+v = 0.6*c; // Speed of first rocket w.r.t. the earth, m/s
+u_prime = 0.9*c; // Speed of second rocket w.r.t. the first, m/s
+// Case 1: Firing in the same direction as that of the first
+u = (u_prime + v)/(1 + u_prime*v/c^2); // Speed of 2nd rocket w.r.t. earth from Velocity Addition Rule
+printf("\nThe speed of second rocket w.r.t. earth fired in the same direction = %5.3fc", u);
+// Case 2: Firing in the opposite direction as that of the first
+u = (-u_prime + v)/(1 - u_prime*v/c^2); // Speed of 2nd rocket w.r.t. earth from Velocity Addition Rule
+printf("\nThe speed of second rocket w.r.t. earth fired in the opposite direction = %5.3fc", u);
+
+// Result
+// The speed of second rocket w.r.t. earth fired in the same direction = 0.974c
+// The speed of second rocket w.r.t. earth fired in the opposite direction = -0.652c