Thanks, Brian. I suspect R S and T are zero because "mysquarecolours" (msc) is called for EVERY pane in the diagram, including those not in the net, which default to black. It just happens that every net has a null pane at the bottom right. msc is not clever enough to check for all 4 colours being identical, so just goes ahead and interpolates between 0 and 0, for AB, and does the same again for DC, and then interpolates between two lines of all zero. Sophisticated stuff!
Anyway, If you try, say, #5 msc GREEN,BLUE,WHITE,:RED you should find: |:AB 0 0 0 0 0 0 1 0.8 0.6 0.4 0.2 0 0 0.2 0.4 0.6 0.8 1 |:CD 1 1 1 1 1 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 FWIW, the code for AB (and CD) is based on the interpolation formula for a point p on line ab where lamda = |ap|/|ab| p = lamda b + (1-lamda) a By the way, I already owned up to gross plagiarism a week or two ago, but it's worth repeating: I adapted the mixing verb from Raul's good work; also indeed the variations on the cube verb. As for the rotations relative to net, here goes. Linda kicked off this patter seeking to find nice representations for one of the nets, which I loosely call a cross, and which is 5{NETS in my script. Now look at 0{NETS, which I choose to call a T-shape. How do you transform the shape in 5{NETS to that in 0{NETS? It helps (perhaps!?) to label the cube's corners as ABCD (front) and EFGH (back face but looking from the front). Well - the LEFT face appears as H E A D, starting from the top right corner going clockwise, in 5{NETS, our quasi-standard. But it's DHEA when in the T-formation, ie it's rotated by one right-angle clockwise. Similarly, the RIGHT face is FGCB in Linda's first layout, 5{NETS, but becomes GCBF in the T-net, 1 rotation anticlockwise. As for the mnemonics for the faces, I inherited TOP BASE FRONT BACK LEFT RIGHT from the preceding correspondence. All but two start with distinct letters, allowing t f l r for their abbreviations, but I needed to distinguish BASE and BACK, and so chose s and k for them. And now I see that I uttered a silly typo - please substitute "NB. NETS - l = Left, r = Right, f = Front," for "NB. NETS - l = Left, r = Red, f = Front," I'll try to correct that on my Google drive, hoping the link isn't destroyed in the process. Have fun, Mike On 02/07/2015 14:06, Brian Schott wrote:
Mike, I think your scripts are very enlightening. I am enjoying trying to better understand them. Thank you very much for your work here. I thought I would try to better understand the issue of some viewmat numbers being over 255. And although I see yours are all limited to 255, I thought I would better understand the issue by studying the nouns AB, CD and their resulting nouns, so I created the globals R, S, and T in msc, as shown below. But to my surprise the resulting arrays contain all zeroes in my experiments. Could you please comment? msc=:mysquarecolours =: 3 : 0 : nsteps =. x 'A B C D'=. y lamda =. (,:~-.)@:(%~ i.@>:) nsteps R=: AB =. lamda +/@:(*/"1) A,:B NB. mix colours between corners A & B S=: CD =. lamda +/@:(*/"1) D,:C NB. mix colours between corners C & D 1 0 2 |: <.T=: 255 * lamda +/@:(*/"1) AB,:CD NB.|: 'cos I got order wrong! ) I am also puzzled over the rotations you mention relative to net #6 faces. Could you say more about that, please? Btw, I will mention 2 peculiarities I noticed. Why name bacK, k instead of b? Why refer to Red as R, instead of Rear as R? But unfortunately, as you can deduce, the depth of my understanding is limited to such "peculiarities". <grin>
--- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm