summaryrefslogtreecommitdiff
path: root/em.awk
diff options
context:
space:
mode:
Diffstat (limited to 'em.awk')
-rw-r--r--em.awk13
1 files changed, 13 insertions, 0 deletions
diff --git a/em.awk b/em.awk
new file mode 100644
index 0000000..1297153
--- /dev/null
+++ b/em.awk
@@ -0,0 +1,13 @@
+#!/usr/bin/awk -f
+
+BEGIN {
+ ARGV[1] ? OFMT = "%." ARGV[1] "g" : OFMT = "%.12g"
+
+ ### constants
+ pi = 4.0*atan2(1,1) # rad
+ c0 = 299792458E0 # m/s, exact
+ mu0 = (4.0E-7)*pi # H/m
+ epsilon0 = (mu0*c0^2)^-1 # F/m
+
+ print pi, c0, mu0, epsilon0
+}