Skip to content

turtle location is wrong after several moves #41

Closed
@ricknun

Description

@ricknun

Turtle command "forward(self, distance: float)" (and likely other commands) truncate turtle location to an integer value after each move. This can accumulate up to a 1 pixel error per turtle move. I would expect that the turtle location be maintained to floating point resolution and then be plotted to the nearest pixel each move. The attached program for a Circuit Playground Bluefruit + TFT Gizmo shows the problem. For example, 105 moves forward of 1.904762 pixels moves 105 pixels, not 105*1.904762 ~= 200. I am using CircuitPython v9.1.4. An image of running the attached .py program is attached too. It's possible this issue goes deeper than just Turtle Graphics -- I don't know what its underlying graphics system is.
turtle_truncate.txt
20241105_141322

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions