Re: turtle coordinates: Y increase downards - as in most graphics API?

kirby urner <[email protected]>
Newsgroups gmane.comp.python.education
Message-ID <CAPJgG3S73dtH4Sz130-g+wp=mSWb9uxp4Xzx0R0OgOHr7ELR6Q@mail.gmail.com>
On Tue, Jun 19, 2018 at 11:20 AM, Andre Roberge <[email protected]>
wrote:

> Is this Python's edu-sig or Monty Python's philosophers club?  ;-) ;-) ;-)
>
>
​I do think we're branching out to discuss coordinate systems more
generally, as a perennial feature of pedagogy.

These more general concerns are distinct from turtle.py in particular.

I hope contributors are not shy about continuing the higher level
discussions.
​

> Anyone on this list could probably do the following in less than one
> minute...
>
>
​Yes, I just ran the following:

>>> turtle.setworldcoordinates(0, -200, 400, 0)
>>> turtle.forward(100)
>>> turtle.right(90)
>>> turtle.forward(100)
>>> turtle.left(90)
>>> turtle.forward(100)
>>>

Here's the resulting graphic output:

https://flic.kr/p/28i3cDY

However in this test, I did not isolate the problem.  The turtle turns to
its own right and then its own left.

I'm assuming lower left is (0, -200) and upper right is (400, 0) i.e. Y
still increases as we go vertically towards the top.

I should change that...

Lets make Y increasingly positive as we go down the screen.

>>> turtle.setworldcoordinates(0,200,400,0)
>>> turtle.forward(100)
>>> turtle.left(90)
>>> turtle.forward(100)
>>> turtle.right(90)
>>> turtle.forward(100)
>>> turtle.right(90)

Indeed, now I see the problem.  The turtle no longer obeys it's own
viewpoint but turns oppositely to what I command.

Here's the graphic output this time:

https://flic.kr/p/26ZJmQ2


Kirby
​

_______________________________________________
Edu-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/edu-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.