[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: Turtle module
From:       boB Stepp <robertvstepp () gmail ! com>
Date:       2021-05-26 23:28:57
Message-ID: CANDiX9JDUqOorD22DPV4bi2oMLwL5Pu+YNOXhe=0ecN3LXWazg () mail ! gmail ! com
[Download RAW message or body]

On Wed, May 26, 2021 at 10:59 AM Michael F. Stemper <mstemper@gmail.com> wrote:

> In order to turn the turtle, I need to select a way to represent
> angles. I could use either degrees or radians (or, I suppose,
> grads). However, for my functions to work, I need to set the
> turtle to that mode. This means that I could possibly mess up
> things for the caller. What I would like to do is capture the
> angle-representation mode on entry and restore it on return.
> However, looking through the methods of turtle.Turtle(), I
> can't find any means of capturing this information

In the "Tell Turtle's state" section
(https://docs.python.org/3/library/turtle.html#tell-turtle-s-state) I
would think that you could roll your own function by using your
knowledge of the coordinates of where the turtle is at and the
turtle.towards(0, 0).  By computing your own angle (knowing what units
you are using) and comparing with what is returned you should be able
to determine what angular units are currently set.

HTH!
boB Stepp
-- 
https://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic