summaryrefslogtreecommitdiff
path: root/em.awk
blob: 2cc6a74ea1067b412b77b24883da2b700437d46e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/awk -f

### em.awk
# list of physical EM constants


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 = (T*m)/A = N/(A^2) = (kg*m)/(A*s)
    epsilon0 = (mu0*c0^2)^-1    # F/m = C/(V*m) = (A^2*s^4)/(kg*m^3)

    print pi, c0, mu0, epsilon0
}