Post Ark7PFeucA74U9x2hM by futurebird@sauropods.win
(DIR) More posts by futurebird@sauropods.win
(DIR) Post #Ark53clno7kbssjYOm by futurebird@sauropods.win
2025-03-05T10:57:26Z
0 likes, 1 repeats
Let's say you want to draw a hypocycloid (spirograph) with a turtle. I use a parametric equation for each of the circles and combining them to find the x and y position of the points on the curve then telling the turtle to goto(x,y)This works fine, however it is NOT in the intended "spirit" of drawing with a turtle. Drawing with a turtle is about "relative" navigation. Consider two ways to draw a circle:for 0<t<2pi: goto(rcos(t), rsin(t))repeat 100: forward 2 right 2
(DIR) Post #Ark5VwycGzNwf8EaAK by futurebird@sauropods.win
2025-03-05T11:02:35Z
0 likes, 0 repeats
The second method is "in the spirit" of turtle drawing... but it's not obvious what the radius is, or even if it will be a full circle or not. I discovered I could reconcile it and made a big mess. (I'm trying to be open minded about programming with blocks but I lowkey hate it. I can't type equations! I have to make them like little snowmen.)I guess what I want is a procedure to convert from relative drawing to coordinate based drawing like when you go from parametric to functions of x.
(DIR) Post #Ark5hKppuNr3qLYXUu by glennsills@dotnet.social
2025-03-05T11:04:33Z
0 likes, 0 repeats
@futurebird Skip this and go straight to teaching them Golang.š
(DIR) Post #Ark62B69IyaTj57oIa by futurebird@sauropods.win
2025-03-05T11:08:25Z
0 likes, 0 repeats
@glennsills golang just looks like some kind of java variant to me (presumably with less strictness to make it less annoying for new programmers?)What really makes it different? I judge a lot about a language based on how it formats loops and functions.I find that for young programmers python is easier. A lot of them REALLY struggle with managing braces correctly. (Although, I'm working on ways to address this.)
(DIR) Post #Ark6GwbJUKC16hk7PM by futurebird@sauropods.win
2025-03-05T11:11:04Z
0 likes, 0 repeats
Here is another way to draw a circle:repeat a lot: pick random(x, y) if distance to center (x, y)==r: draw dot(x,y)I didn't say it was a GOOD way to draw a circle.
(DIR) Post #Ark6Y5uu6YTmvI5H1c by futurebird@sauropods.win
2025-03-05T11:14:10Z
0 likes, 0 repeats
OK one more way to draw a circle.for -1<x<1: goto(x, sqrt(r*r-x*x))for -1<x<1: goto(x, -sqrt(r*r-x*x))We could even use the distance formula again for this one. But everyone knows sin and cos are the most elegant.
(DIR) Post #Ark6cGjroKXne3ucHQ by pikesley@mastodon.me.uk
2025-03-05T11:14:52Z
0 likes, 0 repeats
@futurebird @glennsills https://processing.org/ or https://p5js.org/ might be fun š¤·
(DIR) Post #Ark6iefziyk7cj97Ds by futurebird@sauropods.win
2025-03-05T11:16:04Z
0 likes, 0 repeats
@pikesley @glennsills We use p5js. I like it MUCH more than the blocks. But, there is still that whole issue of relative vs. absolute positioning.
(DIR) Post #Ark6w2oBJUSmETMNDU by futurebird@sauropods.win
2025-03-05T11:18:28Z
0 likes, 0 repeats
@pikesley @glennsills What has golang got that p5js is missing? They seem like kind of the same general idea to me.
(DIR) Post #Ark721FxzoXJ9nCmtU by jpab@mastodon.gamedev.place
2025-03-05T11:19:32Z
0 likes, 0 repeats
@futurebird can turtles learn Bresenham's algorithm?
(DIR) Post #Ark737MMn23mNKirJI by btuftin@social.coop
2025-03-05T11:19:37Z
0 likes, 0 repeats
@futurebird My immediate thought is that this relates to the challenge of a computer image having discrete pixels, and the two methods are at the extremes for solving the issue.The parametric ignores the issue and can draw any spirograph curve, leaving to just straight mathematical rounding to decide the actual curve drawn, which will look nasty for all small features. The true turtle approach is only capable of "curves" with integer steps. Though I suppose you could have some 1/2
(DIR) Post #Ark7PFeucA74U9x2hM by futurebird@sauropods.win
2025-03-05T11:23:47Z
0 likes, 1 repeats
Another way to think about this: if you are drawing "in the spirit" of turtle drawing your turtle is facing in the dy/dx of the curve you are creating at all times and simply going forward. So I could take the derivative of the curve and use that to turn the turtle (relative to its previous position!) a little for each step in the drawing. This sounds even more needlessly complex than what I was doing before but I keep hoping something dead simple will just fall into my lap.
(DIR) Post #Ark7auL3hypHpxDtdA by glennsills@dotnet.social
2025-03-05T11:25:49Z
0 likes, 0 repeats
@futurebird Oh no! Go is what happens when a bunch of good language designers decide Java and C# (and F# and C++) have fatal issues and decide to start from scratch. The idea is to make the compiler so fast it seems like scripting but compile to machine code (instead of a virtual machine - like Java or C#)
(DIR) Post #Ark7b28aiDbg1bS3JA by glennsills@dotnet.social
2025-03-05T11:25:49Z
0 likes, 0 repeats
It supports object orientation without classes. It makes exception handling hard on purpose, to force programmers to check for errors. It is not like Java at all.Golang is to C and Funk is to Motown, although you might not be quite old enough to *feel* the analogy.
(DIR) Post #Ark7lrO31VfPrqqN3g by futurebird@sauropods.win
2025-03-05T11:27:52Z
0 likes, 0 repeats
@glennsills This sounds like it wouldn't have much impact on what I'm concerned with, which is simply getting young people to write functions and loops without getting so frustrated they give up... but also with enough understanding of what they are doing they can apply it to ANY programming language some day and do whatever they want. Basically I'm very happy to avoid teaching about syntax... up to a point.
(DIR) Post #Ark7sOU4si8OFpmPBY by glennsills@dotnet.social
2025-03-05T11:29:01Z
0 likes, 0 repeats
@futurebird @pikesley To be fair I was kidding old guy curmudgeon style. I would teach high school kids Golang before I teach them C. It is probably too much as an intro to programming.That said, starting off with scripting can lead to some pretty bad habit. Just look at the average web page.A good middle ground would be Python.
(DIR) Post #Ark8845CV5mRc9cGMC by mensrea@freeradical.zone
2025-03-05T11:31:48Z
0 likes, 0 repeats
@futurebird in a similar vein if i may direct your attention to https://www.boredpanda.com/funny-worst-input-fields/
(DIR) Post #Ark8BiNR90eXS9t19s by glennsills@dotnet.social
2025-03-05T11:32:30Z
0 likes, 0 repeats
@futurebird Also, my wife is a STEP teacher, pre-K 3 (not kidding) to 5. My wife uses Blockly and Scratch to introduce kids the concept of telling a computer what to do. The youngers ones start with screen free programming using physical icons that they can layout out on the floor and make a robot go.
(DIR) Post #Ark8VP9UKdzZcTkcQy by gkrnours@mastodon.gamedev.place
2025-03-05T11:36:03Z
0 likes, 0 repeats
@futurebird if you replace the test with r-ε ⤠distance to center (x, y) ⤠r + ε, it should draw much faster
(DIR) Post #Ark8Y4HKObIrkZgi3s by btuftin@social.coop
2025-03-05T11:36:33Z
0 likes, 1 repeats
@futurebird I think the only "perfect" solution is an analog computer with a vector display. And I'm reminded of an obsession I had for a while on figuring out if you could make all possible sizes of square by intersecting lines that had to go through at least two (so infinite) integer coordinate point in the plane. I think the answer is no and that I could prove it by relating it to countable vs uncountable infinities.
(DIR) Post #Ark9bOI4Y2L0dhBUVE by Tak@glitch.taks.garden
2025-03-05T11:46:06Z
0 likes, 0 repeats
@futurebird Everything has a monte carlo method
(DIR) Post #Ark9mbf9AekhIWKESW by namelessblob@mastodon.world
2025-03-05T11:50:22Z
0 likes, 0 repeats
@futurebird I don't know about that. Did the turtle agree to this?
(DIR) Post #ArkBXKoRjiZibRWLL6 by futurebird@sauropods.win
2025-03-05T12:10:03Z
0 likes, 0 repeats
@GezThePez python, scratch, java, p5js
(DIR) Post #ArkBzxvvscEm2ffswK by nilesjohnson@mathstodon.xyz
2025-03-05T12:15:07Z
0 likes, 0 repeats
@futurebird In the circle example, it's not obvious (at least to me) how to go from the dy/dx parametrization to the logo commands forward 2; right 2. I guess those commands work because the circle is approximated by a regular n-gon for large n. So, is there a general way to go from tangent parametrization to approximation by a polygon? (I don't know; it seems like a possible way forward though.)
(DIR) Post #ArkC0dD2PvHW3azcnI by futurebird@sauropods.win
2025-03-05T12:15:14Z
0 likes, 1 repeats
@glennsills @pikesley I think python is perfect for education. Itās easy to get started and as you want to do more complicated tasks you donāt discover the walls of the sandbox constraining your growth. The only reason I donāt insist we do everything in python is my commitment to teaching programming concepts in a ālanguage agnostic wayā ā this makes me think exposure to many languages is good. Even exposure to the blocks.
(DIR) Post #ArkCekqjQjlTKtgwRk by pikesley@mastodon.me.uk
2025-03-05T12:22:29Z
0 likes, 0 repeats
@futurebird @glennsills my 9-year-old niece was doing Scratch at school so I had a reason to learn it, ngl, the blocks can be fun
(DIR) Post #ArkEOatkrQt3kQWlPM by LegoPink@mstdn.social
2025-03-05T12:42:02Z
0 likes, 0 repeats
@futurebird @glennsills @pikesley Maybe you would be interested in using #Hedy for teaching pythonhttp://hedy.orgIt's free and open source
(DIR) Post #ArkF9FinPg5hgCeMTY by crabmusket@aus.social
2025-03-05T12:50:28Z
0 likes, 0 repeats
@futurebird "Little snowmen" is a great similar, it's so evocative of the activity of this kind of visual programmingāā
(DIR) Post #ArkFGZSWQapevCWm8m by futurebird@sauropods.win
2025-03-05T12:51:50Z
0 likes, 1 repeats
@GezThePez That is to say I donāt think the language is that important to this question of ārelativeā vs āabsoluteā drawing. Relative drawing is used in education because itās much more intuitive. Writing commands like directions gets kids going. Then at some point (often without ever explaining the change) you start just using coordinatesā I think some kids get lost in that transition and if I can understand it betterā if there is a lesson in making this change it could help.
(DIR) Post #ArkFhfRuGUZBJnA0QK by cxxvii@aus.social
2025-03-05T12:56:41Z
0 likes, 0 repeats
@futurebird @glennsills @pikesley Have you looked at lua, for education? It was what I learnt to program in and love2d is a great well documented graphics/sound/input library. also, its dynamically typed like python but simpler
(DIR) Post #ArkFxhfllWGyqdI728 by llewelly@sauropods.win
2025-03-05T12:59:37Z
0 likes, 0 repeats
@futurebird @GezThePez outside of education, relative drawing is used all the time as well, because things move; first you do relative drawing, then you apply rotations, translations, and perspective transforms.
(DIR) Post #ArkJozw2tcaGhN0b9k by LibreFaso@hostux.social
2025-03-05T13:42:50Z
0 likes, 0 repeats
@futurebird At what age do you consider that blocks aren't the right introduction to code ?@glennsills @pikesley
(DIR) Post #ArkL0M0ZGmXkIQ6Qcq by david_chisnall@infosec.exchange
2025-03-05T13:56:07Z
0 likes, 1 repeats
@futurebird @GezThePez I can confirm that this was something that confused young teenaged me. Not so much the transition but the fact that there wasn't a transition. It wasn't until I learned about affine transforms (a tiny bit at A level, most at university) that I realised that it even was possible to take something from one form of expression and mechanically translate it to the other.This is often also a special case of the distinction between imperative and declarative programming. You wrote both of these as imperative, but, from your original example, the goto is unusual. The way that this is normally written (when introducing children to it) is declaring that a line exists which is drawn for all rho where sin(rho) = cos(rho), whereas the second form is explicitly imperative (you're giving commands to a turtle). I wouldn't normally write the first form with goto, I'd write it just setting pixels.Your third example is also interesting because it's very much a declarative form: a circle is defined as all points that are equidistant in a 2D plane from a defined point. And realising that lets you derive your first form because the first form is 'just' the definition of all possible triangles where the hypotenuse length is a constant. But all of these are forms that provide continuous functions that specify the locations of all of the points on a line, whereas the turtle one is a set of instructions. You can turn the declarative forms into equivalent imperative forms (as you did) by saying 'for each point in some discretised form, draw a line segment or pixel that approximates it'. But transforming it to the imperative form for the turtle is much harder because the quantisation becomes more explicit.And this might be why I haven't done computer graphics since I finished my PhD.
(DIR) Post #ArkP0iADINTspL2YRE by glennsills@dotnet.social
2025-03-05T14:41:00Z
0 likes, 0 repeats
@futurebird I must point out Golang has much more strictness compared to scripting languages like Python and Javascript, but less syntactic sugar than OO languages like Java and C#. This is so that it is less annoying to geezers like me.
(DIR) Post #ArkY475ly4dgb5ezRI by futurebird@sauropods.win
2025-03-05T16:22:28Z
0 likes, 1 repeats
I think there might be something in using āmodā for steps with a constant turn (to draw spirograph like patterns) but one of my students got very distracted and made this mess. Delightful isnāt it.
(DIR) Post #ArkYYsyIWAMNmQpxgW by catilac@infosec.exchange
2025-03-05T16:28:01Z
0 likes, 0 repeats
@futurebird oh which tool is this?
(DIR) Post #ArkZNKrj5BhqlrosiW by futurebird@sauropods.win
2025-03-05T16:37:10Z
0 likes, 0 repeats
@catilac https://snap.berkeley.edu/
(DIR) Post #ArkZcZZIhTTCiNT0hE by bensk@mastodon.social
2025-03-05T16:39:54Z
0 likes, 0 repeats
@futurebird LOVE doing spirographs in block-based coding! With middle schoolers we teach it as a repeated shape off-by-one (so turn 121 degrees to do a triangle spirograph instead of 120 for a repeated triangle, 361 for a square, etc). https://scratch.mit.edu/projects/13505540/editor/
(DIR) Post #ArkaGWfetNLVJOUZ04 by futurebird@sauropods.win
2025-03-05T16:47:09Z
0 likes, 0 repeats
@bensk Gotta check this out laterā are you able to make identical designs with the toy? thatās part of the big idea in all of the activities for grade 5 ā connecting physical drawing machines to programming in the hopes that the code ends up feeling like something more tangible.
(DIR) Post #ArkafAGJLQyt3GNtdA by mattmcirvin@mathstodon.xyz
2025-03-05T16:51:32Z
0 likes, 0 repeats
@futurebird @glennsills I think of golang as "what if C was invented around 2010?"
(DIR) Post #ArkazMXzNX2QweHh0S by dpiponi@mathstodon.xyz
2025-03-05T16:55:06Z
0 likes, 0 repeats
@futurebird Reminds me of the Euler spiralhttps://en.wikipedia.org/wiki/Euler_spiral
(DIR) Post #Arkb0Y1GD8pOoZXbGa by Phosphenes@mastodon.social
2025-03-05T16:55:16Z
0 likes, 0 repeats
@futurebird Kind of reinvented fractals!Each spiral ends with a smaller spiral, though the curves get chunky because line segment length stays about the same.
(DIR) Post #ArkeW3JyBJLQjd0S7E by chrisamaphone@hci.social
2025-03-05T17:34:43Z
0 likes, 0 repeats
@futurebird Iāve been learning to crochet recently and have been having similar thoughts about how one communicates and executes crochet patterns. thereās a real disconnect between āthe goal is to make a squareā (or whatever) and āhereās the sequence of stitches you need to makeā
(DIR) Post #ArkfF74J5yxhO9AObg by catilac@infosec.exchange
2025-03-05T17:42:54Z
0 likes, 0 repeats
@futurebird AH! I remember seeing this at one point. I wonder if these folks were inspired by it: https://www.media.mit.edu/projects/octostudio/overview/
(DIR) Post #Arl3CibJUajPp9zpD6 by dpiponi@mathstodon.xyz
2025-03-05T17:20:39Z
0 likes, 1 repeats
@futurebird Also very similar are "partial Gauss sums". It's pure turtle geometry. You keep a count of the number of (constant length) steps you've taken and you turn by its square (or cube etc.) - suitably scaled.https://www.bennetyee.org/ucsd-pages/pub/Yee-IncGaussSum.pdf
(DIR) Post #ArnUJSITathQMeXfhw by bensk@mastodon.social
2025-03-07T02:24:33Z
0 likes, 0 repeats
@futurebird not sure which curriculum youāre using but we donāt directly model this physically.
(DIR) Post #B16VMZ0x0Gk9mf2tI8 by btuftin@social.coop
2025-12-10T11:24:43Z
0 likes, 0 repeats
@futurebird Good thing I skimmed through the replies. Didn't realize this was old until I saw I'd already replied with similar thoughts I was getting now.
(DIR) Post #B16WHqwqzw0DuYRm2y by futurebird@sauropods.win
2025-12-10T11:35:08Z
0 likes, 0 repeats
@btuftin I'm still looking for a more natural way to describe the spirograph in this context... and it's time for this lesson soon enough so I'm reworking it again.
(DIR) Post #B16YSU7mOdNqDakrQm by btuftin@social.coop
2025-12-10T11:59:25Z
0 likes, 0 repeats
@futurebird I still think part of the challenge is that the parametric function is continuous and turtle thinking is discrete. To make turtle thinking continuous I think the inputs would need to change to speed and turning radius.
(DIR) Post #B16ZDiXuay3MYXV4fg by petealexharris@mastodon.scot
2025-12-10T12:07:57Z
0 likes, 0 repeats
@futurebird It is *conceptually* simple. I know that isn't the same thing as real-life simple.