Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements to Turtle #402

Closed
wants to merge 6 commits into from
Closed

Conversation

katestange
Copy link
Member

By submitting this PR, I am indicating to the Numberscope maintainers that I have read and understood the contributing guidelines and that this PR follows those guidelines to the best of my knowledge. I have also read the pull request checklist and followed the instructions therein.


This PR provides enhancements to the turtle visualizer:

  1. Instead of a "domain" input there's just a modulus and the sequence is automatically taken with respect to that modulus (just like chaos does), so you shouldn't have so many boring thumbnails that go two steps and die.
  2. The number of elements in the "angles" list has to match the modulus; instead of causing an error, the parameter dialog will shorten or lengthen it automatically for you when you change modulus. Similar for other lists.
  3. The step size is now a list of step sizes, like the angles.
  4. There's a path length option.
  5. The default behaviour is to draw the full path from scratch in one frame, no animation.
  6. If you input a growth rate in the Path Growth variable, it will go back to drawing the path at that speed, so you can watch the animation.
  7. If you use the "Turning angle increments" list, the angles in the angle list will gradually change, causing the path to "fold" gradually over itself like a protein. This is fun for finding other variations on a cool picture you've found. This is also an animation feature. You can combine it with growth, or use just one of them.

Note: This turtle visualizer is not backward compatible to past URLs. Is this something we need to add (seems difficult)? Or should we just update the existing gallery items to the new parameter format. This is perhaps a more general question about when visualizers are updated.

The main thing I have not implemented yet, but hope to later, is more colouring options.

To see what it can do, check out some fun ones (note that these URLs only work with this PR). These are all static to begin, but you can animate them.

http://localhost:5173/?name=Beatty+DNA&viz=Turtle&domain=3&turns=79+0+45&steps=5+2+6&pathLength=6000&bgColor=e9eee3&strokeColor=4b7a81&start=0+200&seq=OEIS+A001951

http://localhost:5173/?name=Tau+Goldberg+Machine&viz=Turtle&domain=2&turns=121+0&steps=40+100&pathLength=6000&bgColor=e9eee3&strokeColor=814b7c&start=0+5&seq=OEIS+A000594

http://localhost:5173/?name=Free+Wheelin%27&viz=Turtle&domain=3&turns=127+10+105&steps=40+25+5&pathLength=6000&bgColor=ffffff&strokeColor=5f402b&seq=OEIS+A005228

http://localhost:5173/?name=Hofstader&viz=Turtle&domain=3&turns=137+0+105&steps=15+10+5&pathLength=5000&folding=0+0+0&bgColor=ffffff&strokeColor=7792bb&seq=OEIS+A005228

@katestange katestange changed the base branch from main to ui2 July 25, 2024 00:15
@katestange katestange closed this Jul 25, 2024
@katestange
Copy link
Member Author

Sorry, something with the rebasing isn't right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants