Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
 summaryrefslogtreecommitdiffstats log msg author committer range
path: root/TurtleArt
diff options
 context: 12345678910152025303540 space: includeignore mode: unifiedssdiff
author committer Walter Bender 2011-03-18 02:40:30 (GMT) Walter Bender 2011-03-18 02:40:30 (GMT) 1ce900e8f55b86561ad9766f30841317782ac99c (patch) a1ea91fdae768898388782f6b1a2158e37e6f105 /TurtleArt 3a114935dc7e5d76384cde9a14f722cb4a7bb060 (diff)
using math.pi to make code easier to read
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/taturtle.py10
1 files changed, 5 insertions, 5 deletions
 diff --git a/TurtleArt/taturtle.py b/TurtleArt/taturtle.pyindex 340273d..75bff6a 100644--- a/TurtleArt/taturtle.py+++ b/TurtleArt/taturtle.py@@ -26,7 +26,7 @@ from sprites import Sprite from tautils import debug_output from random import uniform-from math import sin, cos+from math import sin, cos, pi SHAPES = 36 @@ -129,16 +129,16 @@ class Turtle: # Choose a random angle from which to attach the turtle label if turtles.sprite_list is not None: self.spr = Sprite(turtles.sprite_list, 0, 0, self.shapes[0])- angle = uniform(0, 4.10) # 240 degrees+ angle = uniform(0, pi * 4 / 3.0) # 240 degrees w = self.shapes[0].get_width() r = w * 0.67 # Restrict angle the the sides 30-150; 210-330- if angle > 2.05:- angle += 1.57+ if angle > pi * 2 / 3.0:+ angle += pi / 2.0 # + 90 self.label_xy = [int(r * sin(angle)), int(r * cos(angle) + w / 2.0)] else:- angle += 0.52+ angle += pi / 6.0 # + 30 self.label_xy = [int(r * sin(angle) + w / 2.0), int(r * cos(angle) + w / 2.0)] else: