summaryrefslogtreecommitdiff
path: root/em.awk
diff options
context:
space:
mode:
authorwukong <wukong@longaeva>2023-12-18 12:37:31 -0800
committerwukong <wukong@longaeva>2023-12-18 12:37:31 -0800
commit309c5d8f7ff8c36235222d079955cd3783bb7ad0 (patch)
tree22fa0994657cee27292ef1531211a47293afab5f /em.awk
parent0c1d68ee8cc2a631d6029285e771ebbfe119995d (diff)
Added a partially working function performing LU decomposition on a square
matrix, ludcmp.awk. This is providing correct answers on _some_ test data, further testing debugging required here.
Diffstat (limited to '')
-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
+}