Dissect uses isidraw and gllines on Jqt.

Henry Rich

On 1/26/2022 11:58 AM, Raul Miller wrote:
http://www.rosettacode.org/wiki/Fractal_tree#J

I had updated the fractal tree implementation to work with j903. (The
previous code did not work with any implementation of J which I have
installed on my mac -- apparently Apple's changes mean that j504 and
j602 no longer function on this machine.)

However, I noticed that the window is slow to come up, and I cannot resize it,

So, I changed the implementation:

require'gl2'

L0=: 50           NB. initial length
A0=: 1r8p1        NB. initial angle: pi divided by 8
dL=: 0.9          NB. shrink factor for length
dA=: 0.75         NB. shrink factor for angle
N=: 14            NB. number of branches

L=: L0*dL^1+i.N  NB. lengths of line segments

NB. relative angles of successive line segments
A=: A0*(dA^i.N) +/\@:*("1) _1 ^ #:i.2 ^ N

NB. end points for each line segment
P=: 0 0+/\@,"2 +.*.inv (L0,0),"2 L,"0"1 A

wd {{)n
  pc P closeok;
  setp wh 480 640;
  cc C isidraw;
  pshow;
}}

glclear_jgl2_''
gllines_jgl2_ <.@(10 + ,/"2 P-"1<./,/P)

But this version does not draw the fractal tree.

Has anyone been able to get gllines to work in an isidraw?

Thanks,



--
This email has been checked for viruses by AVG.
https://www.avg.com

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

Reply via email to