# File lib/pdf/writer/graphics.rb, line 416 416: def star(cx, cy, length, rays = 5) 417: rays = 4 if rays < 4 418: points = [] 419: part = Math::PI / rays.to_f 420: 421: 0.step((rays * 4), 2) do |ray| 422: if ((ray / 2) % 2 == 0) 423: dist = length / 2.0 424: else 425: dist = length 426: end 427: 428: x = cx + Math.cos((1.5 + ray / 2.0) * part) * dist 429: y = cy + Math.sin((1.5 + ray / 2.0) * part) * dist 430: points << [ x, y ] 431: end 432: 433: polygon(points) 434: move_to(cx, cy) 435: self 436: end