Advertisement
Guest User

mandelbrot (but not working)

a guest
Mar 23rd, 2022
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. 'InitCauseway' 'View' ⎕CY 'sharpplot'
  2. InitCauseway ⍬ ⍝ initialise current namespace
  3.  
  4. pts ← ,(¯2+(⍳300)÷100)∘.+0j1ׯ1+(⍳200)÷100
  5. x ← 9○pts
  6. y ← 11○pts
  7. mandelbrot ← {n←0 ⋄ n⊣⍵{n+←1 ⋄ ⍺+⍵×⍵}⍣{(~(|⍵)≤2)∨n≥80}0}
  8. vals ← mandelbrot¨pts
  9. cl ← ∪vals
  10. type ← cl⍳vals
  11. colors ← 256⊥⍉255,↑3/¨cl
  12.  
  13. sp ← ⎕NEW Causeway.SharpPlot
  14. sp.MarkerLimit ← 0
  15. sp.SplitBy ⊂type
  16. sp.Heading ← 'Mandelbrot Set'
  17. sp.SetMarkers ⊂System.Drawing.Marker.Bullet
  18. sp.SetColors ⊂colors
  19. sp.DrawScatterPlot(x y)
  20. sp.SaveSvg(⊂'samplemand.svg')
  21. ⎕←sp.RenderSvg ⍬
  22.  
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement