Say P is a rank 2 list of 2D coordinates
   4{.P
 0 0
 0 1
 0 2
_1 2

Let's map the flight.

NB. shift moves origin making minimum coordinates independently 0
NB. use: shift COORDINATES
shift=: -"1 <./

NB. grid generates an array of zeros large enough for only the positive coords
NB. use: grid COORDS
grid=: 0 $~ >:@:(>./)

NB. COORDS draw GRID  NB. color by number
draw=: (i.@#@[)`(;/@:[)`]}

load'viewmat'
flight =: viewmat @: (draw grid) @: shift

flight P

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

Reply via email to