Devon, Load 'plot'
Move this line: loopSurfacePlot (1 2 12);0 2p1 99 to the end after loopsurface is defined. Linda -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Devon McCormick Sent: Wednesday, June 05, 2013 7:03 PM To: J-pr eogramming forum Subject: Re: [Jprogramming] plot for parametric surfaces? Here's something I gleaned from the J wiki - it's idiosyncratic code but it works. Try loopSurfacePlot (1 2 12);0 2p1 99 steps=: (0 { ]) + ([: -/ 1 0 { ]) * ([: i. 2 { ]) % [: <: 2 { ] sin=: 1&o. [ cos=: 2&o. v1=: 0{] [ v2=: 1{] p=: 1.5"_ [ q=: 1.6499999999999999"_ ga=: (v1 * cos@v2)"1 [ gb=: (v1 * sin@v2)"1 gc=: (-@(v1 ^ p) + q * ga)"1 gx=: ^@gc"1 y1=: ga [ y2=: gb [ y3=: (ga * gx)"1 vpgen=: 3 : 0 (steps >0{y) ([ ,"0/ ]) steps >1{y ) loopSurfacePlot=: 3 : 0 pd 'viewpoint _3 _5 0.7' pd 'viewsize 1 1 0.5' pd 'type surface' pd (y1;y2;y3) vpgen y pd 'show' NB.EG loopSurfacePlot (1 2 12);0 2p1 99 ) On Wed, Jun 5, 2013 at 6:01 PM, bob therriault <[email protected]>wrote: > Hi Raul, > > It looks to me as if the wiki version is providing an array of shape > 100 > 100 and it is plotting the z values for each position (x,y) within the > array. You would just need to pick your parameter so that it > corresponds to integer positions that would map on to the array and > then insert the value of z at that position (x,y) . > > At least that's is what I see happening, but believe me when I say I > have been wrong before. :-) > > Cheers, bob > > On 2013-06-05, at 2:31 PM, Raul Miller wrote: > > > 'type surface' plot +/~2 o. i:5j99 > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
