Peripheral drift illusion: Difference between revisions

Content added Content deleted
m (→‎{{header|Raku}}: clean up some stray white space)
m (→‎{{header|Raku}}: Reduce image file size; remove a bunch of redundant information)
Line 270: Line 270:


my @blocks = (1..15 X 1..10).map: -> ($X, $Y) {
my @blocks = (1..15 X 1..10).map: -> ($X, $Y) {
my $r = (($X + $Y) div 2) % 4 * 90;
my $x = $X * 75;
my $x = $X * 75;
my $y = $Y * 75;
my $y = $Y * 75;
:use['xlink:href' => '#block', 'transform' => "rotate($r,$x,$y) translate($x,$y)"]
my $a = (my $r = ($X + $Y) div 2 % 4 * 90) > 0 ?? "rotate($r,$x,$y) " !! '';
:use['xlink:href'=>'#block', 'transform'=>"{$a}translate($x,$y)"]
}
}


Line 283: Line 283:
:g[
:g[
:id<block>,
:id<block>,
:polygon[:points<-25,-25,-25,25,25,25>, :style<fill:white;stroke:white>],
:polygon[:points<-25,-25,-25,25,25,25>, :fill<white>],
:polygon[:points<25,25,25,-25,-25,-25>, :style<fill:black;stroke:black>],
:polygon[:points<25,25,25,-25,-25,-25>, :fill<black>],
:rect[:x<-20>, :y<-20>, :width<40>, :height<40>, :fill<#3250ff>]
:rect[:x<-20>, :y<-20>, :width<40>, :height<40>, :fill<#3250ff>]
]
]