This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, docs@python, eric.araujo, georg.brandl, gregorlingl, terry.reedy
Date 2010-10-21.20:19:54
SpamBayes Score 1.1237554e-06
Marked as misclassified No
Message-id <1287692411.21.0.472855700629.issue10170@psf.upfronthosting.co.za>
In-reply-to
Content
As Terry J. Reedy mentioned in his comment on issue 7061, turtle documentation is lacking information on how speed "codes" 0-10 translate into actual turtle speed.

Attached script measures the speed of the two primitive operations that form the basis of turtle functionality at various speed settings.  The results below show highly irregular pattern.  The columns are: the speed code, time to draw a 200 unit line, time to complete a 360 degrees turn and the ratio of the two times.


         0: 0.01 0.01 0.83
         1: 1.04 2.05 0.51
         2: 0.49 1.06 0.46
         3: 0.30 0.72 0.42
         4: 0.23 0.54 0.44
         5: 0.17 0.44 0.38
         6: 0.13 0.39 0.35
         7: 0.08 0.32 0.26
         8: 0.08 0.28 0.30
         9: 0.10 0.27 0.37
        10: 0.08 0.23 0.36


From the source code, it appears that the on-screen speed is controlled by the number of animation steps while each step takes approximately time controlled by the "delay" setting that defaults to 10 milliseconds.

The number of steps is determined by somewhat peculiar computations.  For a rotation by angle of a degrees at speed setting s, the number of steps is

       n = 2 + int(a / (3 * s))

and for drawing a line of length d,

       n = 1 +  int(d / (3 * 1.1**s * s))

I am not sure what was the reason for these choices, but I think it would be better if numeric speed code had a more direct relationship to the apparent speed.
History
Date User Action Args
2010-10-21 20:20:11belopolskysetrecipients: + belopolsky, georg.brandl, terry.reedy, gregorlingl, eric.araujo, docs@python
2010-10-21 20:20:11belopolskysetmessageid: <1287692411.21.0.472855700629.issue10170@psf.upfronthosting.co.za>
2010-10-21 20:19:55belopolskylinkissue10170 messages
2010-10-21 20:19:54belopolskycreate