From 9cf999f802b30a50453af430b3764ebc2282376b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 10 Feb 2025 01:14:12 +0530 Subject: Add dragon curve --- 2-dragon/main.ua | 18 ++++++++++++++++++ 2-dragon/output.png | Bin 0 -> 1388 bytes README.md | 1 + 3 files changed, 19 insertions(+) create mode 100644 2-dragon/main.ua create mode 100644 2-dragon/output.png diff --git a/2-dragon/main.ua b/2-dragon/main.ua new file mode 100644 index 0000000..86ece69 --- /dev/null +++ b/2-dragon/main.ua @@ -0,0 +1,18 @@ +W ← 200 +H ← 200 +S ← 4 +I ← 2 + +P ← ℂ: + +PStart ← [(P (-(÷2 S) ÷2 W) (÷2 H)) (P (+(÷2 S) ÷2 W) (÷2 H))] + +RotP ← +× ⊙⤚- P ∿+η ⊙∿. +Dragon ← ⍥(⊂ RotP η ⊣. ⇌.)I PStart +IsOnLine ← <0.01 ⌵- /+ ⊙(⌵-⊃⊢⊣)◡(⌵-) ⊟ +IsOnDragon ← ⊙◌ ≥1 /+ ≡(IsOnLine⊃⊢⊣) ⧈∘ 2 Dragon + +ToPix ← ⨬(0_0_0)(255_255_255) IsOnDragon + +Img ← ∵ToPix (⍉ ⊞P ⇡W⇡H) +&fwa "./2-dragon/output.png" img "png" Img diff --git a/2-dragon/output.png b/2-dragon/output.png new file mode 100644 index 0000000..6c02658 Binary files /dev/null and b/2-dragon/output.png differ diff --git a/README.md b/README.md index 886daa0..b6e41f1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # Playing with [uiua](https://www.uiua.org/) +![mandelbrot fractal](./1-mandelbrot/output-1080.png) -- cgit v1.3.1