Coding Challenge

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 พ.ค. 2024
  • In this Coding Challenge, I visualize a "Lissajous Curve Table" with Processing (Java). Code: thecodingtrain.com/challenges...
    🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
    🎥 Previous video: • Coding Challenge #115:...
    🎥 Next video: • Coding Challenge #117:...
    🎥 All videos: • Coding Challenges
    References:
    🗄 Lissajous Curve on Wikipedia: en.wikipedia.org/wiki/Lissajo...
    🐦 Panlepan Twitter: / 954694464697720833
    🐦 Julio Mulero Twitter: / 1039456605736185856
    Videos:
    🎥 Lissajous Curves with p5.js: • Coding Challenge #116 ...
    🎥 Lissajous Curve by standupmaths: • Making a physical Liss...
    🎥 Polar Coordinates: • 3.4 Polar Coordinates ...
    🎥 Harmonic motion: • 3.5 Simple Harmonic Mo...
    🎥 2D Arrays in JavaScript: • 9.15: 2D Arrays in Jav...
    🔴 Coding Train Live 152: • Coding Train Live #152...
    Related Coding Challenges:
    🚂 #55 Mathematical Rose Patterns: • Coding Challenge #55: ...
    🚂 #60 Butterfly Generator: • Coding Challenge #60: ...
    🚂 #81 Circle Morphing: • Coding Challenge #81.1...
    🚂 #133 Times Tables Cardioid Visualization: • Coding Challenge #133:...
    🚂 #134 Heart Curve: • Coding Challenge #134....
    🚂 #C1 Maurer Rose: • Coding the Maurer Rose
    Timestamps:
    0:00 Introducing today's topic
    0:30 Inspiration
    1:53 Important elements
    4:28 Size of the boxes
    5:09 Add circles at top of canvas
    7:08 Use polar to cartesian coordinates to determine the offset
    8:05 Draw a point on the circles
    9:17 Add a line
    9:52 Adjust speed of rotation based the circle's index
    10:40 Add circles along left of canvas
    12:05 Create a Curve class
    13:24 Draw the path of the curve
    15:00 2D arrays
    16:06 Matrices are expressed as "row by column"
    19:07 Set x and y points for all row and column combination
    20:52 Draw the points
    21:52 Highlight the points
    23:30 Refinements: reverse direction of rotation and reset the circles
    27:27 Thank you for watching!
    Editing by Mathieu Blanchette
    Animations by Jason Heglund
    Music from Epidemic Sound
    🚂 Website: thecodingtrain.com/
    👾 Share Your Creation! thecodingtrain.com/guides/pas...
    🚩 Suggest Topics: github.com/CodingTrain/Sugges...
    💡 GitHub: github.com/CodingTrain
    💬 Discord: thecodingtrain.com/discord
    💖 Membership: th-cam.com/users/thecodingtrainjoin
    🛒 Store: standard.tv/codingtrain
    🖋️ Twitter: / thecodingtrain
    📸 Instagram: / the.coding.train
    🎥 Coding Challenges: • Coding Challenges
    🎥 Intro to Programming: • Start learning here!
    🔗 p5.js: p5js.org
    🔗 p5.js Web Editor: editor.p5js.org/
    🔗 Processing: processing.org
    📄 Code of Conduct: github.com/CodingTrain/Code-o...
    This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
    #lissajouscurve #polarcoordinates #processing

ความคิดเห็น • 145

  • @trans_foxgirl
    @trans_foxgirl 5 ปีที่แล้ว +187

    I wonder what the curves would look like in 3D, like another set of sin waves that control height?

    • @CalSeedy
      @CalSeedy 5 ปีที่แล้ว +1

      In 3D I think you would need another angle.

    • @morphman86
      @morphman86 5 ปีที่แล้ว +10

      You need a third set of wheels for a third dimension. So yeah, basically another set of sine waves.
      It will look rather similar, but with another dimension added. The circles will be spheres, the arcs will be semispheres etc.
      The interesting thing is that a three-dimensional lissajous is only possible in a virtual environment, as the "arms" would cross each other and the lines would intersect.
      But copy the project and add another dimension to it, change to P3D and check for yourself.

    • @spectralpiano3881
      @spectralpiano3881 5 ปีที่แล้ว +2

      A 3d lissajous curve is basically 3 lissajous curves merged, if you look from infinity in the x direction you'll see a 2d lissajous curve created by the circles rotating in the y and z plane. If looking from the y axis you'll see the lissajous from xz and from the z axis you'll see the xy curve.
      I made a 4d version projected to 3d quite recently, a bit harder to imagine/understand that but it's fun to play around with ^^

    • @Bolt6265
      @Bolt6265 5 ปีที่แล้ว +49

      i made this for fun i guess
      gfycat.com/ColorfulMeatyAmericankestrel

    • @k1ngjulien_
      @k1ngjulien_ 5 ปีที่แล้ว +1

      @@Bolt6265 dang that's cool!

  • @rolfvankleef8439
    @rolfvankleef8439 5 ปีที่แล้ว +58

    The error you got is a but in JOGL. It is harmless and can be ignored. It will be silenced in a later release.

  • @dawalton7435
    @dawalton7435 5 ปีที่แล้ว +13

    5:46 I like how the captions just read "(silly noises)". You are literally my favourite youtuber and give me my will to survive at times.

  • @owlsurojit
    @owlsurojit 5 ปีที่แล้ว +84

    Could someone please make a remix of 5:43 to 5:47 ? Because that's hilarious ^^
    PS: Love your videos; It is you who motivated me to become a programmer...

    • @letsgocamping88
      @letsgocamping88 5 ปีที่แล้ว +1

      Owl Surojit some beatboxing eh

    • @georgeyjm
      @georgeyjm 5 ปีที่แล้ว +2

      I was playing at 1.5x speed😂had to stop at this part

  • @jorgedominguez9484
    @jorgedominguez9484 5 ปีที่แล้ว +6

    I love how you seem to have so much fun doing these videos haha keep it up man you made me get into coding

  • @xRoGeSx
    @xRoGeSx 5 ปีที่แล้ว +1

    Saw the tiny bit of those cuves in Matt Parker video myself, coded it myself and then here you are! Amazing to see another style of coding for the identical tasks.

  • @QuickAnalysis
    @QuickAnalysis 3 ปีที่แล้ว

    I never normally comment on youtube videos but you have helped me be able to code some mathematical ideas of my own I have had for years but not been able to progress them any further, thank you for bringing me your videos.

  • @lapischicken
    @lapischicken 5 ปีที่แล้ว +174

    Pff this is easy
    ..to watch

    • @forloop7713
      @forloop7713 5 ปีที่แล้ว +8

      ...if you aren't following

  • @maxteer2800
    @maxteer2800 4 ปีที่แล้ว +6

    It feels like I'm learning, but really I'm just watching art

  • @eugen189763987689379
    @eugen189763987689379 5 ปีที่แล้ว

    Wow, rarely have been so excited to enjoy a video!!

  • @chicapercebe
    @chicapercebe 2 ปีที่แล้ว

    I was searching about lissajous curves and thought it would be cool to write it in processing, I'm glad there is a video about that! You are the best :D

  • @juansebastianosorio6757
    @juansebastianosorio6757 5 ปีที่แล้ว

    I Love your videos! Thanks for your amazing positiveness. Greetings from Colombia

  • @d_v_d1070
    @d_v_d1070 5 ปีที่แล้ว +4

    Yay Processing 3 is used again . Daniel hope you see that videos you make with Processing 3 are watched the most often ( * hint* hint* :) ), maybe a topic regarding the some applications of sharders might be good , huge huge admirer of all the work you do

  • @jimrummy1300
    @jimrummy1300 5 ปีที่แล้ว

    ABC Aus! Wonderful video Dan. I love your work. You are sensational!

  • @Holobrine
    @Holobrine 5 ปีที่แล้ว +1

    The order of rows and columns still fits the standard (x,y) notation, because the computer reads right-to-left to define the array. When you go to access it though, it reads left-to-right.
    Think of it like a low-level list and a high-level list. You define bottom up, but you access top down.

  • @timatiloh9653
    @timatiloh9653 5 ปีที่แล้ว

    it really looks so cool, just like pure harmonics in nature

  • @johnkarippery511
    @johnkarippery511 5 ปีที่แล้ว

    very nice how you think like that.. without any stuck you are a genius bro

  • @plary
    @plary 5 ปีที่แล้ว +1

    Nice! Great video as always, Dan!

  • @amirulidzham3686
    @amirulidzham3686 5 ปีที่แล้ว

    Thanks for the great video. I want to know why did you choose eclipse for the dots along the circle? Why not use vertex?

  • @albertemc2stein290
    @albertemc2stein290 5 ปีที่แล้ว +3

    When you searched for the saved frame of the table the file name was something like "lissajous00629" although you saved it as "lissajous####.jpg" is this some command for saving it with a certain numeric code?

  • @kipchickensout
    @kipchickensout 5 ปีที่แล้ว

    you didn't make me get into coding but watching your videos is hella fun

  • @smanzoli
    @smanzoli 5 ปีที่แล้ว +2

    Love your videos, congratulations!
    And after watching I always rewrite from zero in Processing.py, but never, NEVER using classes at all... imho they only add weight, complexity and let everything less obvious and unclear, with longer code. Sure, all "objects" as arrays, but never in the pseudo oop way, just hate it in "anything bellow 1000 lines" (aka "simple stuff", where I do not need lots of classes and tons of objects). But YES, it gratley serves the purpose to TEACH oop, damn it, and you do it great!
    And again, your channel is AWESOME, and YOU are awesome! Keep the passion and the great mood!

  • @goldenfreddy8649
    @goldenfreddy8649 5 ปีที่แล้ว +1

    I’m so confused, yet so satisfied. This was pretty cool!

  • @lemon3389
    @lemon3389 5 ปีที่แล้ว +1

    I ended up taking the challenge and did it myself
    In 1h45... I rarely program so cut me some slack
    BUT I succeeded!

  • @jsg425
    @jsg425 5 ปีที่แล้ว +5

    I love your videos! I learn so much from them. I understand programming concepts as taught by you quicker and more completely than anyone else. I also love how you problem solve as you go. It helps me see the process. Keep it up, my man!

  • @peterhayman
    @peterhayman 5 ปีที่แล้ว

    you're a magician dan

  • @marco_gallone
    @marco_gallone 5 ปีที่แล้ว +1

    This could be a real cool application/integration for the new Fourier videos you’re in the process of making. This code can be remixed to visualize a 3D phase map the combination of 3 separate circle rates and amplitudes. Let me know what you think!

  • @patrick.1943
    @patrick.1943 5 ปีที่แล้ว

    Youre so smart man!

  • @liquidexw
    @liquidexw 5 ปีที่แล้ว

    if you want really good performance, use the FX2D renderer

  • @ffggddss
    @ffggddss 5 ปีที่แล้ว

    Not watched yet, so I may be repeating things you'll say here, but here goes:
    This is something I tackled on a graphing calculator some years ago, using parametric curves with horizontal and vertical sine waves of different integer frequencies. What I found trickiest was choosing the relative phases so that the curves never came to a "point," but always flowed as a complete, continuous curve. I solved that problem by the following rules:
    Parameter = t; (x,y) = (f(mt), g(nt))
    where m & n are positive integers; and f and g are each either sin or cos, chosen independently.
    And to make those choices, first test the parity of m and n. Then:
    (1) If at least one of them is odd, then that one gets cos; the other gets sin, whether it's even or odd.
    (2) If both are even, repeatedly divide both by 2 until condition (1) holds, then apply that rule. [But still use the original m,n to draw.]
    There are always other choices that will achieve the desired result, but this is the simplest set of rules that always work.
    And here's another insight into Lissajous figures: All of these result from orthographic projection of a sine wave, drawn on a strip of width W, then rolled into a cylinder of height W, with the sine wave's frequency chosen so that the rolled-up version matches the sine curve smoothly with itself.
    And the same L-Curve can be produced by one sine wave rolled up horizontally, or another sine wave rolled up vertically.
    In either case, the phase can be changed by simply rotating the cylinder continuously on its axis; this gives the full, general case of L-Curves.
    OK, watched it now. Really neat!
    So I leave it to you to try these phasing rules or not; what you've got is awesome enough. So just if you're interested...
    Fred

  • @LoganGuerra
    @LoganGuerra 2 ปีที่แล้ว

    Nice thanks

  • @trans_foxgirl
    @trans_foxgirl 5 ปีที่แล้ว +18

    I first saw the Lissajous demonstration in the standupmaths video, and I wanted to see if I could do this in Python. I havent tried it out, but Ill follow along as I watch, converting to Python... ^_^

    • @zawmaciek
      @zawmaciek 5 ปีที่แล้ว

      What do you use to render live graphics in python?

    • @thrownofgrace
      @thrownofgrace 5 ปีที่แล้ว

      Hey, how do i show graphics. Have you tried that already, i mean in python?

    • @trans_foxgirl
      @trans_foxgirl 5 ปีที่แล้ว +1

      I use Zelle's graphics.py library, with a few tweaks. That does 2D rendering. Very simple to work with. But performance is terrible the more drawn objects there are (as Python runs code sequentially) I had to generate the curves first, them render it all at once. If you want 3D graphics, there are other librarys better suited (or you can do what I did and create a framework for n-dimensional vectors and points, and over time create projections for higher dimensions)

    • @OonHan
      @OonHan 5 ปีที่แล้ว +1

      well, this probably was just a Parker Square of a video

    • @merthyr1831
      @merthyr1831 5 ปีที่แล้ว

      Could true arcade.academy. OpenGL accelerated.

  • @akunanonim8105
    @akunanonim8105 5 ปีที่แล้ว

    As an electrical engineering student, I admit that this is awesome

  • @kevnar
    @kevnar 4 ปีที่แล้ว

    Coming soon, in a future episode of The Coding Train: Lissajou curves... in 3D!!!

  • @syxwolf373
    @syxwolf373 5 ปีที่แล้ว

    Masterrrr!

  • @Jacker_Deluxe
    @Jacker_Deluxe 5 ปีที่แล้ว +2

    Hey Dan! You can use Processing's built-in attribute functions like ellipseMode(CORNER) for drawing circles from their upper-left corner. That way you won't have to calculate the circles' center offset.^^

  • @BaronVonTacocat
    @BaronVonTacocat 5 ปีที่แล้ว

    Very cool.
    *: D*

  • @juanluisclaure6485
    @juanluisclaure6485 5 ปีที่แล้ว

    this is too good to be

  • @ruby_wired
    @ruby_wired 5 ปีที่แล้ว

    12 rows and 23 columns. That's a minute or so of my life well spent.

  • @ddavity
    @ddavity 5 ปีที่แล้ว

    Just saw that Lissajous gif on Twitter and were asking to myself "hey, that could be a nice project to do on Processing...". And here it is! Thank you!

  • @rlasc84
    @rlasc84 5 ปีที่แล้ว

    I tried to do in one loop but still need the functions addX and addY. If I add the point only get the circles in diagonal.

  • @nazishahmad1337
    @nazishahmad1337 5 ปีที่แล้ว +1

    This lissajouss figure is created when we superpose two SHM with different frequency

  • @rovatk373
    @rovatk373 5 ปีที่แล้ว

    Cool

  • @brandonhuynh6153
    @brandonhuynh6153 5 ปีที่แล้ว

    Make a Spirograph simulation! I think that’d be cool along side this as things that are fun to watch

    • @TheCodingTrain
      @TheCodingTrain  5 ปีที่แล้ว +3

      i traveled back in time to make this video for you! th-cam.com/video/0dwJ-bkJwDI/w-d-xo.html

  • @dukestt
    @dukestt 5 ปีที่แล้ว

    I got it...........almost, in VB. Its kinda the same that is to say it draws the paths but no circles at the top of the columns or rows. Its a work in progress i guess.

  • @magenoir999
    @magenoir999 5 ปีที่แล้ว +2

    omg around 25:40 shifman got compressed out of reality

    • @zperk13
      @zperk13 4 ปีที่แล้ว

      more so around 25:00

  • @porigonopop
    @porigonopop 4 ปีที่แล้ว

    It look like the sierpinski triangle pattern when you increase the number of circle, kinda fun imo

  • @egomanque
    @egomanque 5 ปีที่แล้ว

    优秀

  • @pinkierar_real
    @pinkierar_real 5 ปีที่แล้ว

    Люблю твои видео! Ты очень позитивный и занимаешься хорошим делом))

  • @RupertBruce
    @RupertBruce 2 ปีที่แล้ว

    When you are iterating over rows, cols use r, c instead of i, j

  • @thedarkglovemusic
    @thedarkglovemusic 3 ปีที่แล้ว

    OMG OMG OMG OMG LEAVE THE CASINO LEAVE THE CASINO
    It's OK.
    He fixed the second HALF_PI sneakily around 19:37

  • @phrebh
    @phrebh 5 ปีที่แล้ว

    Finally! Rows, columns! lol

  • @letsgocamping88
    @letsgocamping88 5 ปีที่แล้ว

    I had literally the same thought when I saw Matt Parker’s video

  • @leandroboog1311
    @leandroboog1311 5 ปีที่แล้ว

    *dinnnng* processing, now processing is a java based programming enviroment ...
    I parrot along ever since my 2nd episode =>

  • @netanelberman6291
    @netanelberman6291 3 ปีที่แล้ว

    5:43 ahh ohh uhh ehh ahh

  • @lennart7912
    @lennart7912 4 ปีที่แล้ว

    someone know how I can give every curve a unique coloring?

  • @Blananas2
    @Blananas2 5 ปีที่แล้ว

    The chances of the URL starting with two hyphens after the equal is 1/64^2... and you got it.

  • @MinthZe
    @MinthZe 5 ปีที่แล้ว

    Can you do a version of this in 3d?

  • @sujals7108
    @sujals7108 5 ปีที่แล้ว

    The code runs fast i the start but when one of the shapes finishes and starts overlapping, the code becomes very slow. is there any way to fix this?

    • @renealgera
      @renealgera 5 ปีที่แล้ว

      This is because the program keeps adding points to the path. Even if the Lisa-figure is complete. I added a check if the last point added (self.current) is equal to curves[row].col].path[0] (the first point in the path). If so, then the path is closed and the Lisa-figure complete. So you don't have to add more points. However, some Lisa-figures are now only drawn in half: because the path crosses the first point. Haven't a solution for that just now...

    • @sujals7108
      @sujals7108 5 ปีที่แล้ว

      @@renealgera I already fixed the part where it keeps on adding points. So when all the curves are completed, it becomes fast. But It becomes slow even before all the figures are completed, even if one is completed,

  • @lorenzm7412
    @lorenzm7412 5 ปีที่แล้ว

    would like to see you try to replicate the growth of a slimemold in p5.js

    • @lorenzm7412
      @lorenzm7412 5 ปีที่แล้ว

      If that is even possible

  • @grantdelacy4537
    @grantdelacy4537 5 ปีที่แล้ว

    The pattern made by these curves at 25:04 looks as if it is following the left visualisation shown here: mathworld.wolfram.com/LeastCommonMultiple.html

  • @Squire3555
    @Squire3555 5 ปีที่แล้ว

    I need that whistle

    • @akgrs83
      @akgrs83 5 ปีที่แล้ว

      Dan sells them at amazon.com - www.amazon.com/ideas/amzn1.account.AFRDHABWPWJEAX34FWZKCMUULDTA/FTP7TKU60DU5

  • @ambarishphysics
    @ambarishphysics 2 ปีที่แล้ว

    CHECK OUT MY ORIGINAL CHALLENGE ON LISSAJOUS PATTERNS HERE:
    th-cam.com/video/uiFvAT0Z5zM/w-d-xo.html

  • @khushitshah979
    @khushitshah979 5 ปีที่แล้ว

    I created this in java a week ago and now i am seeing this video... i dont known its name. I made it after watching a video of ted which shows pattern of 3/4

  • @Diamonddrake
    @Diamonddrake 5 ปีที่แล้ว +2

    The angle is offset when being used, so your angle reset is out of phase. But really cool

  • @ranielyfire
    @ranielyfire 5 ปีที่แล้ว

    You should do a break down on some of the “Art” programs on the site called complexification .net. Its run by Jared Tarbel although he no longer posts new pieces. But his art is cool and he posts the source code!

    • @cashel1111
      @cashel1111 5 ปีที่แล้ว

      what a site! very impressive images

  • @kipchickensout
    @kipchickensout 5 ปีที่แล้ว +1

    is there a tshirt for it? I'll refactor this later? xd

    • @TheCodingTrain
      @TheCodingTrain  5 ปีที่แล้ว +2

      Well, there is, hah! www.designbyhumans.com/shop/codingtrain

  • @higuy55100
    @higuy55100 5 ปีที่แล้ว +6

    now move the circles with perlin noise instead

  • @LifEsYouTubeChannel
    @LifEsYouTubeChannel 5 ปีที่แล้ว +4

    "I is iterating through all columns" isn't it supposed to be "I am"?
    Just kidding... 😁 Nice video as always

  • @OonHan
    @OonHan 5 ปีที่แล้ว +6

    Goodness, a Parker Square of a video

  • @ruchisheth9430
    @ruchisheth9430 4 ปีที่แล้ว +1

    why is the pvector current reintialized in the addPoint function?

  • @vierajohaninecova3998
    @vierajohaninecova3998 5 ปีที่แล้ว

    Matt Parker fanclub

  • @sebastianiuga3020
    @sebastianiuga3020 4 ปีที่แล้ว

    Don't know what kind of diseases your affected by but thanks the explanations.

  • @MarinusMakesStuff
    @MarinusMakesStuff 4 ปีที่แล้ว

    At 6:40 'Can I make that look nicer?'
    Well: pixelDensity(displayDensity());

  • @eeddeellwweeiiss
    @eeddeellwweeiiss 5 ปีที่แล้ว +7

    Do a rubicks cube next time

  • @biogpy5509
    @biogpy5509 3 ปีที่แล้ว

    Can i get algorithm plz sir?

  • @offtheball87
    @offtheball87 5 ปีที่แล้ว

    Are you on Mastodon, can I follow you??

  • @mrrandom2484
    @mrrandom2484 5 ปีที่แล้ว +2

    The dots alone look kind of like moving water

  • @ricardo.mazeto
    @ricardo.mazeto 5 ปีที่แล้ว

    27:30, find the pretzel.

  • @fixedfuji
    @fixedfuji 5 ปีที่แล้ว

    The error is only on Macs that use the graphics card. More often than not, you can ignore the error. However, I hooked up an Arduino and a gesture sensor to a Processing sketch. Input from the sensor would crash the sketch when using P2D. The program would run fine (albeit slower) without P2D. I could use arrow key presses to replace the gesture sensor input and P2D without the sketch crashing.

  • @luismiguelgallegogomez8000
    @luismiguelgallegogomez8000 5 ปีที่แล้ว

    15:35 Hahaha :) I agree rows and columns in that order is more standard, but without a doubt, when I declare matrices that carry even a minimal of "cartesianity" meaning, I always go for X and Y order. I think code should be the more unambiguous the better. I even prefer to call the iteraring variables x and y, instead of i and j... XD

  • @voxeledphoton
    @voxeledphoton 5 ปีที่แล้ว

    27:37

  • @Otakutaru
    @Otakutaru 5 ปีที่แล้ว

    sin waves under an oscilloscope XY anyone?

  • @davidjeremy6790
    @davidjeremy6790 5 ปีที่แล้ว

    Hey Dan. Nice video!! For a future coding challenge it would be awesome if you can try to implement a griddlers solver. It would be really cool I think. For some info and ideas of what this is:
    www.griddlers.net/es/home

    • @TheCodingTrain
      @TheCodingTrain  5 ปีที่แล้ว

      Please suggest here! github.com/CodingTrain/Rainbow-Topics/issues

    • @davidjeremy6790
      @davidjeremy6790 5 ปีที่แล้ว

      Done!

  • @ReverendFlatus
    @ReverendFlatus 5 ปีที่แล้ว

    It looks like there is a phase difference between the columns and rows.

  • @user-iv6ox5wf8o
    @user-iv6ox5wf8o 5 ปีที่แล้ว

    Please teach python please

  • @ara7546
    @ara7546 5 ปีที่แล้ว

    Hey can you build cryptography ? using an algorithm like Lattice-based? it is post-quantum proof algo,here is wiki page en.wikipedia.org/wiki/Lattice-based_cryptography

  • @FINFilmersyay
    @FINFilmersyay 5 ปีที่แล้ว +1

    First

  • @CaelVK
    @CaelVK 5 ปีที่แล้ว

    please make a video about kotlin

  • @lutzweb
    @lutzweb 5 ปีที่แล้ว

    As a computer science, I am sorry to say that is very cool but very poor implemented. in the table there are repeating patterns, would have been much more interesting plotting non multiple frequency and get more patterns or not to redraw multiple, and even , to fasten the process, to detect the completed picture and stop (just detect both circles have completed the loop) :-) By the way, I understand the coding exercise, but again, as computer enthusiast we should not forget the basic: this is the classica exercize for NON digital computer, can be done with 0 lines of codes, just running an xy oscilloscope and 2 function generators, and I am sure.... it will even run faster :-)