.PS
# CONSTANTS
pi = atan2(0, -1);
cx = 1
cy = 0
r = 1

# CONFIG
circle rad r

# DRAW PIE SEGMENTS
for i = 1 to 6 do {
  a = i * pi / 5

  x1 = cx + r * cos(a)
  y1 = cy + r * sin(a)

  x2 = cx + r * cos(a + pi)
  y2 = cy + r * sin(a + pi)

  line from (x1, y1) to (x2, y2)
}

# DRAW SEGMENT LABELS
#   using a macro
#   and a 'copy thru' macro here
#   because i seem unable
#   to access looping variable
#   inside of a for loop
#   the way i want to.
#   meanwhile,
#   this seems to work just fine
space = 0.2
define labeler {
  a = ($1 + 0.5) * pi / 5;
  "$1" at ( \
    cx + (r + space) * cos(a) * -1, \
    cy + (r + space) * sin(a) \
  )
}
copy thru @ labeler($1) @ until "YEEEHAW"
1
2
3
4
5
6
7
8
9
10
YEEEHAW
.PE
