lambdaway
::
sierpinsky3
5
|
list
|
login
|
load
|
|
_h1 sierpinsky {sup ([[triangle|?view=sierpinsky]] | carpet {sup ([[2|?view=sierpinsky2]]|3|[[4|?view=sierpinsky4]]|[[5|?view=sierpinsky5]]|[[6|?view=sierpinsky6]]|[[7|?view=sierpinsky7]])}} {center Refresh the screen to see other random colors.} {svg {@ width="580" height="580" style="box-shadow:0 0 8px #000;"} {sierp 580 3} } {pre '{def sierp {def sierp.r {lambda {:x :y :w :c :n} {square :x :y :w :c} {if {< :n 0} then else {let { {:lx {- :x :w}} {:x :x} {:rx {+ :x :w}} {:ly {- :y :w}} {:y :y} {:ry {+ :y :w}} {:w {/ :w 3}} {:rc {rc}} {:n {- :n 1}} } {sierp.r :lx :ly :w :rc :n} {sierp.r :x :ly :w :rc :n} {sierp.r :rx :ly :w :rc :n} {sierp.r :rx :y :w :rc :n} {sierp.r :rx :ry :w :rc :n} {sierp.r :x :ry :w :rc :n} {sierp.r :lx :ry :w :rc :n} {sierp.r :lx :y :w :rc :n} }}}} {lambda {:w :n} {square {/ :w 2} {/ :w 2} :w {rc}} {sierp.r {/ :w 2} {/ :w 2} {/ :w 3} {rc} :n} }} -> {def sierp {def sierp.r {lambda {:x :y :w :c :n} {square :x :y :w :c} ;; {text {@ x="{- :x {/ :w 4.0}}" y="{+ :y {/ :w 3.2}}" style="font-family:times; font-size::w; stroke:#000; fill::c;"}λ} {if {< :n 0} then else {let { {:lx {- :x :w}} {:x :x} {:rx {+ :x :w}} {:ly {- :y :w}} {:y :y} {:ry {+ :y :w}} {:w {/ :w 3}} {:rc {rc}} {:n {- :n 1}} } {sierp.r :lx :ly :w :rc :n} {sierp.r :x :ly :w :rc :n} {sierp.r :rx :ly :w :rc :n} {sierp.r :rx :y :w :rc :n} {sierp.r :rx :ry :w :rc :n} {sierp.r :x :ry :w :rc :n} {sierp.r :lx :ry :w :rc :n} {sierp.r :lx :y :w :rc :n} }}}} {lambda {:w :n} {square {/ :w 2} {/ :w 2} :w {rc}} {sierp.r {/ :w 2} {/ :w 2} {/ :w 3} {rc} :n} }} '{def rc {lambda {} rgb({* 255 {random}}, {* 255 {random}}, {* 255 {random}})}} -> {def rc {lambda {} rgb({* 255 {random}},{* 255 {random}},{* 255 {random}})}} '{def square {lambda {:x :y :w :c} {rect {@ x="{- :x {/ :w 2}}" y="{- :y {/ :w 2}}" width=":w" height=":w" fill=":c"}}}} -> {def square {lambda {:x :y :w :c} {rect {@ x="{- :x {/ :w 2}}" y="{- :y {/ :w 2}}" width=":w" height=":w" fill=":c"}}}} '{sierp 580 3} } _h2 surface _p The [[area of the carpet|https://en.wikipedia.org/wiki/Sierpiński_carpet]] is {b s = w{sup 2} * (8/9){sup n}} and tends to zero (in standard Lebesgue measure) when {b n -> ∞}. {prewrap '{def surf {lambda {:w :n} {round {* {pow :w 2} {pow {/ 8 9} :np}}}}} -> {def surf {lambda {:x :y} {round {* {pow :x 2} {pow {/ 8 9} :y}}}}} '{S.map {surf 100} {S.serie 0 85}} // a 10*10 square, 85 timesp -> {S.map {surf 100} {S.serie 0 85}} } _p Mobile phone and Wi-Fi fractal antennas have been produced in the form of few iterations of the Sierpiński carpet. Due to their self-similarity and scale invariance, they easily accommodate multiple frequencies. They are also easy to fabricate and smaller than conventional antennas of similar performance, thus being optimal for pocket-sized mobile phones. _img data/sierpinsky_screen.jpg
lambdaway v.20211111