*

\ take the center as origin
: o .5 .5 ;
\ half band width
: w .25 ;
\ covert degree to radius
: deg> pi 180 / * ;
\ the band at p of deg and width
: b ( p deg width -- band )
>r deg> >r
y swap - r@ cos * swap
x swap - r> sin * -
abs r> < ;
\ the distance to center
: r y - 2 ** swap x - 2 ** +
sqrt ;
\ convert radius to degree
: >deg 180 pi / * ;
\ the degree of angle at center
: a y - swap x - atan2 >deg 360 mod ;
\ take degree for cos
: cos deg> cos ;
o 0 w b o a cos -.5 > *
o 60 w b o a 120 + cos -.5 > *
o -60 w b o a 120 - cos -.5 > *
o r .5 <

comments powered by Disqus