-- Simple example of clockwise (right hand) circular polarization.
-- Both E and B rotate clockwise while remaining at right angles to each other.
-- To see the rotation, suppose you are standing at location z=0 at time t=0.
-- You observe E=(0,1,0), that is, E pointing to 12 o'clock.
-- Now increase t a little bit by just waiting.
-- What happens is the y component decreases and the x component increases.
-- So now, instead of pointing straight up, E points to the right a little.
-- Keep waiting and eventually observe E=(1,0,0), E pointing to 3 o'clock.
-- E has rotated a quarter turn.
-- Let t run freely and the rotation continues.
-- Define vectors E and B.
E = (sin(t+z), cos(t+z), 0)
B = (cos(t+z), -sin(t+z), 0)
-- Check Maxwell's equations.
check(div(E) = 0)
check(curl(E) + d(B,t) = 0)
check(div(B) = 0)
check(curl(B) - d(E,t) = 0)
check(dot(E,B) = 0)
-- Already shown to be true by Maxwell above but do this anyway...
check(dot(E,B) = 0) -- Check right angle
check(dot(E,E) - dot(B,B) = 0) -- Check equal length
-- If we get here then everything checks out, print OK.
"OK"