reference about jit.expr


    Jan 30 2010 | 8:01 pm
    Hi all.
    I have a lot of questions about jit.expr (like how to map a char matrix to values from -10 to 10 for instance, how does work the beautiful Andrew Benson's shatter patch to generate this kind of grid with this texture, like what isthe purpose of "%" in: jit.expr @expr "(cell[0]%4.>0.)*(cell[0]%4.
    Anyway I would like to know if there was some detailed docs about this amazing object ?
    Thx.
    Ad.

    • Feb 01 2010 | 7:21 pm
      "%" is a common modulo operator. In this case, we're feeding cell[0] (the x-dimension coordinate of the cell) through a %4 to create a repeating 0-3 sequence across the x-axis of the matrix. The rest of the math there is just a complicated way of creating a {0,1,1,0} sequence across the x-dimension of the matrix. You would probably be well-served to look at a reference for writing mathematical expressions in C. If you have more specific questions, ask away.
    • Feb 02 2010 | 12:27 pm
      As always, THANK YOU Andrew !
      I'm going to check mathematical expressions in C.
      Bien à toi !
      Ad.