[Jprogramming] waves

Bo Jacoby bojacoby at yahoo.dk
Sat Jan 21 18:51:05 HKT 2012


Hello J-ers.
Consider this
   wave=: 3 : 0
   ('N';'D';'L';'S')=.y
   A=.,(i.N)j./-i.D 
   k=.(0j_2p1%L)&* 
   c=.S&*&^&+ 
   (+ c&.k)A
   )

   'dot; pensize 4' plot wave 65 29 32 _0.5 

Maximize the plot window to get the proportions right.
This shows the power of J, arrays, and the complex number exponential function.
Do anyone know how to animate this such that the waves are rolling?

-Bo


More information about the Programming mailing list