On Mon, Apr 5, 2010 at 6:25 AM, Kip Murray <[email protected]> wrote:
> For n dimensions the orientation I choose is the circular order of the
> standard
> unit vectors as rows in the n by n identity matrix, it being understood that
> the
> last row is between the next to last row and the first row.
Ok, then
facepoints=: ,/@~.@:| * _1 ^ 2 #:@i...@^ #
Example use:
facepoints 1 _1 1
Note that cubes with different orientations, and non-"cubes",
will cause an error.
If you do not care about that, you could instead use
fp=: {. * _1 ^ 2 #:@i...@^ #
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm