Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Pentagram/Raku/pentagram.raku
Normal file
20
Task/Pentagram/Raku/pentagram.raku
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
use SVG;
|
||||
|
||||
constant $dim = 200;
|
||||
constant $sides = 5;
|
||||
|
||||
my @vertices = map { 0.9 * $dim * cis($_ * τ / $sides) }, ^$sides;
|
||||
|
||||
my @points = map |*.reals.fmt("%0.3f"),
|
||||
flat @vertices[0, 2 ... *], @vertices[1, 3 ... *], @vertices[0];
|
||||
|
||||
say SVG.serialize(
|
||||
svg => [
|
||||
:width($dim*2), :height($dim*2),
|
||||
:rect[:width<100%>, :height<100%>, :style<fill:bisque;>],
|
||||
:polyline[ :points(@points.join: ','),]
|
||||
:style("stroke:blue; stroke-width:3; fill:seashell;"),
|
||||
:transform("translate($dim,$dim) rotate(-90)")
|
||||
],
|
||||
],
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue