Diagram.py: add a draw_star() wrapper, don't open-code apothem calculation
[experiments/RadialSymmetry.git] / RadialSymmetryDiagram.py
index 09a3638..ba0a716 100755 (executable)
@@ -99,12 +99,8 @@ class RadialSymmetryDiagram(Diagram.Diagram):
                               theta, None, color)
 
         if model.show_stars:
-            apothem = model.element_radius * cos(pi / model.element_sides)
-            apothem_angle = theta + pi / model.element_sides
-
-            sverts = self.get_regular_polygon(x, y, model.element_sides, apothem,
-                                              apothem_angle)
-            self.draw_star(x, y, sverts, color)
+            self.draw_star(x, y, model.element_sides, model.element_radius,
+                           theta, color)
 
 
 if __name__ == '__main__':