Thanks very much for highlighting that Jan-Pieter, I am aware of power conjunctions, although I can see that they could have a much bigger scope of application than I can imagine.
I must confess that I have not looked at the Fractal Lab yet, even though I have been taking "first steps" in J for, ooh, several years now! I'll try to remedy that very soon. On 23 April 2014 17:42, Jan-Pieter Jacobs <[email protected]>wrote: > There is no need for your boxing, just the parentheses suffice when > combined with concatenation. > > mx =: +/ . * > sin =: 1&o. > cos=: 2&o. > rotation =: (cos , -@sin) ,:sin , cos > rotate =: (mx~ rotation)~ NB. φ rotate x y > > > If these are the first steps with J, prepare for some amazement indeed! > > Eg. the power conjunction: > > clean =: (* |@*) NB. clean small values from the output for clarity: > NB. rotate a point in steps of 45 degrees, nine steps > > clean 1r4p1 rotate^:(<9) ] 1 1 > > You might want to check out the Lab: Fractals, Visualization & J. It > contains quite a bit on transformations. > > Kind regards, > > Jan-Pieter > > > 2014-04-23 18:16 GMT+02:00 alexgian <[email protected]>: > > > OK, this won't impress any old hands, but I loved the way this turned out > > so easy! > > A matrix of rotation for a point on a 2-d plane: > > > > rotation =: [: > (cos;-&sin),:sin;cos > > > > rotate =: (mx~ rotation)~ NB. φ rotate x y > > > > > > Hm, looking at it now, I could have the unbox in the rotate function > rather > > than the rotation matrix, I'l go try that now. > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
