Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
31
Task/Pentagram/Red/pentagram.red
Normal file
31
Task/Pentagram/Red/pentagram.red
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
Red [
|
||||
Source: https://github.com/vazub/rosetta-red
|
||||
Tabs: 4
|
||||
Needs: 'View
|
||||
]
|
||||
|
||||
canvas: 500x500
|
||||
center: as-pair canvas/x / 2 canvas/y / 2
|
||||
radius: 200
|
||||
|
||||
points: collect [
|
||||
repeat vertex 10 [
|
||||
angle: vertex * 36 + 18 ;-- +18 is required for pentagram rotation
|
||||
either vertex // 2 = 1 [
|
||||
keep as-pair (cosine angle) * radius + center/x (sine angle) * radius + center/y
|
||||
][
|
||||
keep as-pair (cosine angle) * radius * 0.382 + center/x (sine angle) * radius * 0.382 + center/y
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
view [
|
||||
title "Pentagram"
|
||||
base canvas white
|
||||
draw compose/deep [
|
||||
fill-pen mint
|
||||
polygon (points)
|
||||
line-width 3
|
||||
line (points/1) (points/5) (points/9) (points/3) (points/7) (points/1)
|
||||
]
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue