Ok, Kip wanted faces, not face points...

But what does that mean?

In some examples, he was using vectors running
from the center of the cube to the corners, but
his question was about cubes not described that
way.  His question was about cubes described by
vectors running from one corner of the cube to its
diagonal opposite.

I am still trying to puzzle out what he meant by his
example data for faces -- if faces are represented by
located vectors for the faces, and the cube had corners
with coordinates _1 and 1 then all faces should be
described by located vectors with coordinates _1 and 1.

But that is not how his example data looks -- it has
zeros in it.

This leaves us with a problem of ambiguous notation.
But presumably, in the absence of any test data,
any solution which satisfies the verbal description
should be adequate.  Thus, I think this qualifies
as a complete solution:

facepoints=: ,/@~.@:| * _1 ^ 2 #:@i...@^ #
F=: {. (] +"1 facepoints@:-) +/ %#
face=: ] ,:"1 [ #~ 1 = ] +/@:="1 [
faces=: ((face {.), (face {:))@F


Example use:
   faces 1,:3#_1

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to