2007/5/17, Oleg Kobchenko <[EMAIL PROTECTED]>:

Well, if has to be 3D, how about this

  view 5#.^:_1]21-~a.i.'j*ez`C3\toy.G)'
      ________________________
     |\     \     \     \     \
     | \_____\_____\_____\_____\
     | |     |     |     |\     \
     |\|     |     |     | \_____\
     | \_____|_____|_____| |     |
     | |     |   | |     |\|     |
      \|     |   |\|     | \_____|
       \_____|   | \_____|
                 | |     |
                 |\|     |
                 | \_____|
______           | |     |
|\     \          |\|     |
| \_____\_________|_\_____|
| |\     \     \     \    |
\| \_____\_____\_____\   |
| |     |     |     |___|
  \|     |     |     |
   \_____|_____|_____|


Hi,
     ________________________
     |\     \     \     \     \
     | \_____\_____\_____\_____\
     | |     |     |     |\     \                     NB. It is beautiful,
but it would be
     |\|1 0 0|2 0 0|3 0 0| \_____\         NB. thought-provoking scenery
     | \_____|_____|_____| |     |         NB. a T-shirt with cubes
(voxels)
     | |     |   | |     |\|4 0 1|                  NB. identificated by
their coordinates
      \|1 1 0|   |\|3 1 0| \_____|
       \_____|   | \_____|
                 | |     |
                 |\|3 2 0|
                 | \_____|
______           | |     |
|\     \          |\|3 3 0|
| \_____\_________|_\_____|
| |\     \     \     \    |
\| \_____\_____\_____\4 0|
 | |     |     |     |___|
  \|0 4 1|1 4 1|2 4 1|
   \_____|_____|_____|
       ________________________
     |\     \     \     \     \
     | \_____\_____\_____\_____\
     | |     |     |     |\     \
     |\|   C |  CF |  Co | \_____\            NB. but - perhaps - more
interesting
     | \_____|_____|_____| |     |          NB. with "integrated"
coordinates,
     | |     |   | |     |\|  CD |                   NB. i.e. with "spatial
alphabetizing"
      \|   U |   |\|  CR | \_____|
       \_____|   | \_____|
                 | |     |
                 |\|  UI |
                 | \_____|
______           | |     |
|\     \          |\|  Uo |
| \_____\_________|_\_____|
| |\     \     \     \    |
\| \_____\_____\_____\UR |
 | |     |     |     |___|
  \|  RS |  RV |  UY |
   \_____|_____|_____|

Step ba step:
  #'j*ez`C3\toy.G)'             NB. a string with chars indexed from  the
a. j-alphabet
  a.i.'j*ez`C3\toy.G)'
106 42 101 122 96 67 51 92 116 111 121 46 71 41
  21-~a.i.'j*ez`C3\toy.G)'
85 21 80 101 75 46 30 71 95 90 100 25 50 20
  ]xyz=:5#.^:_1]21-~a.i.'j*ez`C3\toy.G)'
3 2 0                               NB. list of coordinates converted from
the string
0 4 1
3 1 0
4 0 1
3 0 0
1 4 1
1 1 0
2 4 1
3 4 0
3 3 0
4 0 0
1 0 0
2 0 0
0 4 0

Let use only a subset from j-abc: the vabc as 27 digits of a 3D vectorial
number system.

     vabc=:'oABCDEFGHIJKLMNOPQRSTUVWXYZ'
  alfavek=: 3 : 0            NB. verb for. converting x y z to this
vector-alphabet
if.0=+/|y do. A=.'o' else.  A=.''
while.+./0~:y do.y=.3%~y-j-3*j=2[A=.A,~vabc{~3#.|.j=.3|y end.
end.
A
)
  decivek=:3 :'3#.|.|:j-3*2=j=.3 3 3x#:,,.vabc i.y'  NB. for converting
back to x y z

  ]XYZ=:alfavek &.>;/xyz
┌──┬──┬──┬──┬──┬──┬─┬──┬──┬──┬──┬─┬──┬──┐
│DF│CL│AC│AJ│Ao│CM│D│DN│DC│Do│AA│A│AB│CC│
└──┴──┴──┴──┴──┴──┴─┴──┴──┴──┴──┴─┴──┴──┘
  >decivek &.>XYZ
3 2 0
0 4 1
3 1 0
4 0 1
3 0 0
1 4 1
1 1 0
2 4 1
3 4 0
3 3 0
4 0 0
1 0 0
2 0 0
0 4 0

Details in
Kádár, I. - Busics, Gy. -  Papp, E.:
"GPS data integration by simulated vector arithmetic in J"
Proceedings of the First Conference on J Programming Language,
June 24-25, 1996, Toronto
http://www.jsoftware.com/pipermail/programming/2006-August/003039.html
http://www.jsoftware.com/pipermail/programming/2006-August/003051.html
http://www.jsoftware.com/pipermail/programming/2006-August/003063.html
http://www.jsoftware.com/pipermail/programming/2007-March/005373.html
<http://www.mail-archive.com/[email protected]/msg01899.html>
Regards,
Istvan Kadar
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to