summaryrefslogtreecommitdiff
path: root/1985/CH12/EX12.2/Chapter12_example2.sce
diff options
context:
space:
mode:
Diffstat (limited to '1985/CH12/EX12.2/Chapter12_example2.sce')
-rwxr-xr-x1985/CH12/EX12.2/Chapter12_example2.sce12
1 files changed, 12 insertions, 0 deletions
diff --git a/1985/CH12/EX12.2/Chapter12_example2.sce b/1985/CH12/EX12.2/Chapter12_example2.sce
new file mode 100755
index 000000000..3ae8f067b
--- /dev/null
+++ b/1985/CH12/EX12.2/Chapter12_example2.sce
@@ -0,0 +1,12 @@
+clc
+clear
+//Input data
+E=3//Energy of photon in eV
+c=3*10^8//Velocity of light in m/s
+e=1.6*10^-19//Charge of electron in Columbs
+
+//Calculations
+p=((E*e)/c)/10^-27//The momentum of the photon in kg.m/s
+
+//Output
+printf('The momentum of the photon is %3.1f*10^-27 kg.m/s',p)