Essays/SpaceTime2D/SpaceTime2D06

From J Wiki
Jump to navigation Jump to search


5 Files

NB. ... script SpaceTime2D.ijs (continued) ...

aRget     =:".@(1!:1)@<@(],'S'"_)$,@:(_&".&>)@cutopen@toJ@(1!:1)@<
aRgetArray=:aRget@((jhostpath(jpath '~temp'),'/','arrays'),'/',],'/',[)

aRput     =:(":@$@[1!:2<@(],'S'"_))1:toHOST@,@(,"1&LF)@":@[1!:2<@]
aRputArray=:4 : 0
thisDir=.jhostpath(jpath '~temp'),'/','arrays','/',>0{y
logDir =.thisDir,'/','LOG'

aRlogEntry=.([:".'6!:0 ''hh:mm:ss DD/MM/YY'''"_),' ',],LF"_
(aRlogEntry 'start ',x) 1!:3 <logDir
9!:11 [17
if.(#y)=3 do.
   n1a=.(>1{y) x~ >2{y
else.
   n1a=.>1{y
end.
n1a  aRput thisDir,'/',x
n2a=.aRget thisDir,'/',x
(aRlogEntry 'end   ',x) 1!:3 <logDir
n1a-:n2a
)

aRbaseWrite=:3 : 0
scriptDir=.jhostpath jpath '~temp'
mainDir  =.scriptDir,'/','arrays'
thisDir  =.mainDir,'/',>0{y
logDir   =.thisDir,'/','LOG'

dirCreate=.1!:5`0:@.(#@(1!:0))
dirList  =.1!:0@<@((thisDir,'/','*')"_)
deleteOne=.1!:55@<@((thisDir,'/'),>@(0{]))
deleteAll=.0:`(deleteOne"1)@.(#>0:)@dirList

dirCreate <mainDir
dirCreate <thisDir
deleteAll''

'' 1!:2 <logDir

ret=.1
ret=.ret*.'xcdv'       aRputArray (0{y),(1{y),<vGen >2{y
ret=.ret*.'xcdvdv'     aRputArray (0{y),(1{y),<vGen >2{y
ret=.ret*.'xcdvdvdv'   aRputArray (0{y),(1{y),<vGen >2{y
ret=.ret*.'xcdvdvdvdv' aRputArray (0{y),(1{y),<vGen >2{y
ret=.ret*.'qcdy'       aRputArray (0{y),(1{y),<(>1{y) ycC vGen >2{y
ret=.ret*.'qcdydy'     aRputArray (0{y),(1{y),<(>1{y) ycC vGen >2{y
ret=.ret*.'qcdydydy'   aRputArray (0{y),(1{y),<(>1{y) ycC vGen >2{y
ret=.ret*.'qcdydydydy' aRputArray (0{y),(1{y),<(>1{y) ycC vGen >2{y
ret=.ret*.'tdq'        aRputArray (0{y),(1{y),<(>1{y) qcC vGen >2{y
ret=.ret*.'tdqdq'      aRputArray (0{y),(1{y),<(>1{y) qcC vGen >2{y
ret=.ret*.'tdqdqdq'    aRputArray (0{y),(1{y),<(>1{y) qcC vGen >2{y
ret=.ret*.'tdqdqdqdq'  aRputArray (0{y),(1{y),<(>1{y) qcC vGen >2{y

ret=.ret*.'zRargR0'    aRputArray (0{y),2{y
ret=.ret*.'zRargL0'    aRputArray (0{y),0{>1{y
ret=.ret*.'zRargL1'    aRputArray (0{y),1{>1{y
ret=.ret*.'zRargL2'    aRputArray (0{y),2{>1{y
ret=.ret*.'zRargL3'    aRputArray (0{y),3{>1{y
ret=.ret*.'zRargL4'    aRputArray (0{y),4{>1{y

(([:1!:1<@(scriptDir,'/',]))([1!:2<@(thisDir,'/','zR',]))]) 'SpaceTime2D.ijs'

ret=.ret*.aRqcdvGen >0{y
ret=.ret*.aRtdvGen  >0{y
ret
)

aRqcdvGen =:3 : 0
ret=.1

xcdv          =.('xcdv'       aRgetArray y)"_
xcdvdv        =.('xcdvdv'     aRgetArray y)"_
xcdvdvdv      =.('xcdvdvdv'   aRgetArray y)"_
xcdvdvdvdv    =.('xcdvdvdvdv' aRgetArray y)"_
qcdy          =.('qcdy'       aRgetArray y)"_
qcdydy        =.('qcdydy'     aRgetArray y)"_
qcdydydy      =.('qcdydydy'   aRgetArray y)"_
qcdydydydy    =.('qcdydydydy' aRgetArray y)"_

ret           =.ret*.'qcdv' aRputArray y;(aRL y)qcdv''

qcdvdvt1      =.((aRL y)qcdvdvt1'')"_
qcdvdvt2p0    =.((aRL y)qcdvdvt2p0'')"_
qcdvdvt2      =.((aRL y)qcdvdvt2'')"_
ret           =.ret*.'qcdvdv' aRputArray y;(aRL y)qcdvdv''

qcdvdvdvt1    =.((aRL y)qcdvdvdvt1'')"_
qcdvdvdvt2p0  =.((aRL y)qcdvdvdvt2p0'')"_
qcdvdvdvt2    =.((aRL y)qcdvdvdvt2'')"_
qcdvdvdvt3p0  =.((aRL y)qcdvdvdvt3p0'')"_
qcdvdvdvt3p1  =.((aRL y)qcdvdvdvt3p1'')"_
qcdvdvdvt3    =.((aRL y)qcdvdvdvt3'')"_
ret           =.ret*.'qcdvdvdv' aRputArray y;(aRL y)qcdvdvdv''

qcdvdvdvdvt1  =.((aRL y)qcdvdvdvdvt1'')"_
qcdvdvdvdvt2p0=.((aRL y)qcdvdvdvdvt2p0'')"_
qcdvdvdvdvt2  =.((aRL y)qcdvdvdvdvt2'')"_
qcdvdvdvdvt3p0=.((aRL y)qcdvdvdvdvt3p0'')"_
qcdvdvdvdvt3  =.((aRL y)qcdvdvdvdvt3'')"_
qcdvdvdvdvt4p0=.((aRL y)qcdvdvdvdvt4p0'')"_
qcdvdvdvdvt4p1=.((aRL y)qcdvdvdvdvt4p1'')"_
qcdvdvdvdvt4  =.((aRL y)qcdvdvdvdvt4'')"_
qcdvdvdvdvt5p0=.((aRL y)qcdvdvdvdvt5p0'')"_
qcdvdvdvdvt5p1=.((aRL y)qcdvdvdvdvt5p1'')"_
qcdvdvdvdvt5p2=.((aRL y)qcdvdvdvdvt5p2'')"_
qcdvdvdvdvt5  =.((aRL y)qcdvdvdvdvt5'')"_
ret           =.ret*.'qcdvdvdvdv' aRputArray y;(aRL y)qcdvdvdvdv''
ret
)

aRtdvGen     =:3 : 0
ret=.1

tdq          =.('tdq'        aRgetArray y)"_
tdqdq        =.('tdqdq'      aRgetArray y)"_
tdqdqdq      =.('tdqdqdq'    aRgetArray y)"_
tdqdqdqdq    =.('tdqdqdqdq'  aRgetArray y)"_
qcdv         =.('qcdv'       aRgetArray y)"_
qcdvdv       =.('qcdvdv'     aRgetArray y)"_
qcdvdvdv     =.('qcdvdvdv'   aRgetArray y)"_
qcdvdvdvdv   =.('qcdvdvdvdv' aRgetArray y)"_

ret          =.ret*.'tdv' aRputArray y;(aRL y)tdv''

tdvdvt1      =.((aRL y)tdvdvt1'')"_
tdvdvt2p0    =.((aRL y)tdvdvt2p0'')"_
tdvdvt2      =.((aRL y)tdvdvt2'')"_
ret          =.ret*.'tdvdv' aRputArray y;(aRL y)tdvdv''

tdvdvdvt1    =.((aRL y)tdvdvdvt1'')"_
tdvdvdvt2p0  =.((aRL y)tdvdvdvt2p0'')"_
tdvdvdvt2    =.((aRL y)tdvdvdvt2'')"_
tdvdvdvt3p0  =.((aRL y)tdvdvdvt3p0'')"_
tdvdvdvt3p1  =.((aRL y)tdvdvdvt3p1'')"_
tdvdvdvt3    =.((aRL y)tdvdvdvt3'')"_
ret          =.ret*.'tdvdvdv' aRputArray y;(aRL y)tdvdvdv''

tdvdvdvdvt1  =.((aRL y)tdvdvdvdvt1'')"_
tdvdvdvdvt2p0=.((aRL y)tdvdvdvdvt2p0'')"_
tdvdvdvdvt2  =.((aRL y)tdvdvdvdvt2'')"_
tdvdvdvdvt3p0=.((aRL y)tdvdvdvdvt3p0'')"_
tdvdvdvdvt3  =.((aRL y)tdvdvdvdvt3'')"_
tdvdvdvdvt4p0=.((aRL y)tdvdvdvdvt4p0'')"_
tdvdvdvdvt4p1=.((aRL y)tdvdvdvdvt4p1'')"_
tdvdvdvdvt4  =.((aRL y)tdvdvdvdvt4'')"_
tdvdvdvdvt5p0=.((aRL y)tdvdvdvdvt5p0'')"_
tdvdvdvdvt5p1=.((aRL y)tdvdvdvdvt5p1'')"_
tdvdvdvdvt5p2=.((aRL y)tdvdvdvdvt5p2'')"_
tdvdvdvdvt5  =.((aRL y)tdvdvdvdvt5'')"_
ret          =.ret*.'tdvdvdvdv' aRputArray y;(aRL y)tdvdvdvdv''
ret
)

aRR =:'zRargR0' aRgetArray]
aRL0=:'zRargL0' aRgetArray]
aRL1=:'zRargL1' aRgetArray]
aRL2=:'zRargL2' aRgetArray]
aRL3=:'zRargL3' aRgetArray]
aRL4=:'zRargL4' aRgetArray]
aRL =:aRL0;aRL1;aRL2;aRL3;aRL4

xcdvA      =:'xcdv'       aRgetArray gXID
xcdvdvA    =:'xcdvdv'     aRgetArray gXID
xcdvdvdvA  =:'xcdvdvdv'   aRgetArray gXID
xcdvdvdvdvA=:'xcdvdvdvdv' aRgetArray gXID
tdvA       =:'tdv'        aRgetArray gXID
tdvdvA     =:'tdvdv'      aRgetArray gXID
tdvdvdvA   =:'tdvdvdv'    aRgetArray gXID
tdvdvdvdvA =:'tdvdvdvdv'  aRgetArray gXID

aRsetA=:3 : 0
mXv02=:xcdvA;0;0;0;tdvA;0;0;0:
mXv04=:xcdvA;xcdvdvA;0;0;tdvA;tdvdvA;0;0:
mXv06=:xcdvA;xcdvdvA;xcdvdvdvA;0;tdvA;tdvdvA;tdvdvdvA;0:
mXv08=:xcdvA;xcdvdvA;xcdvdvdvA;xcdvdvdvdvA;tdvA;tdvdvA;tdvdvdvA;tdvdvdvdvA
0 0$0
)


... write files (to J 'temp' directory) ...


GST0600C.jpg


NB. ... execute (ijx) ...

   v2pts=.0.01 0.646447 10,:0 2p1 33

   aRbaseWrite 'P';(0.25;0.25;1;11.62;1);v2pts
1
   aRbaseWrite 'Q';(_0.125;0;1;11.62;1);v2pts
1


GST0601C.jpg


NB. ... execute (ijx) ...

   aRsetA''
   p6a1d1=.(((aRL'P'),<'P');<(aRL'Q'),<'Q')mcv''
   mXsetV''
   p6a1d2=.((aRL'P');<aRL'Q')mcv(vGen aRR'P')
   p6a1d1-:!.0 p6a1d2
1
   (p6a1d1=.0),p6a1d2=.0
0 0

   aRsetA''
   p6a2d1=.(((aRL'P'),<'P');<(aRL'Q'),<'Q')mcvdv''
   mXsetV''
   p6a2d2=.((aRL'P');<aRL'Q')mcvdv(vGen aRR'P')
   p6a2d1-:!.0 p6a2d2
1
   (p6a2d1=.0),p6a2d2=.0
0 0

   aRsetA''
   p6a3d1=.(((aRL'P'),<'P');<(aRL'Q'),<'Q')mcvdvdv''
   mXsetV''
   p6a3d2=.((aRL'P');<aRL'Q')mcvdvdv(vGen aRR'P')
   p6a3d1-:!.0 p6a3d2
1
   (p6a3d1=.0),p6a3d2=.0
0 0

   aRsetA''
   p6a4d1=.(((aRL'P'),<'P');<(aRL'Q'),<'Q')mcvdvdvdv''
   mXsetV''
   p6a4d2=.((aRL'P');<aRL'Q')mcvdvdvdv(vGen aRR'P')
   p6a4d1-:!.0 p6a4d2
1
   (p6a4d1=.0),p6a4d2=.0
0 0

   aRsetA''
   p6a5d1=.(((aRL'P'),<'P');<(aRL'Q'),<'Q')mcn''
   mXsetV''
   p6a5d2=.((aRL'P');<aRL'Q')mcn(vGen aRR'P')
   p6a5d1-:!.0 p6a5d2
1
   (p6a5d1=.0),p6a5d2=.0
0 0

   aRsetA''
   p6a6d1=.(((aRL'P'),<'P');<(aRL'Q'),<'Q')mcndv''
   mXsetV''
   p6a6d2=.((aRL'P');<aRL'Q')mcndv(vGen aRR'P')
   p6a6d1-:!.0 p6a6d2
1
   (p6a6d1=.0),p6a6d2=.0
0 0

   aRsetA''
   p6a7d1=.(((aRL'P'),<'P');<(aRL'Q'),<'Q')mcndvdv''
   mXsetV''
   p6a7d2=.((aRL'P');<aRL'Q')mcndvdv(vGen aRR'P')
   p6a7d1-:!.0 p6a7d2
1
   (p6a7d1=.0),p6a7d2=.0
0 0


GST0602C.jpg


GST0603C.jpg


NB. ... execute (ijx) ...

   p6bXd1=.((aRL'P'),<'P');<(aRL'Q'),<'Q'

   aRsetA''
   p6bXd1*./@(*./)@((2 2$1 0 0 1"_)((2^_41)gXteq[;])"2(2^_39)&gXtsz@(mcv gXsmx"2 mcn))''
1



Download: File:LST0600C.txt
Download: File:LST0601C.txt
Download: File:LST0602C.txt
Download: File:LST0603C.txt




Download MoinMoin source: File:SpaceTime2D06.ijs




Next Page: Essays/SpaceTime2D/SpaceTime2D07
Prev Page: Essays/SpaceTime2D/SpaceTime2D05




Contributed by Tom Allen