Coding Challenge

Поделиться
HTML-код
  • Опубликовано: 22 янв 2025

Комментарии • 185

  • @codingphysics695
    @codingphysics695 6 лет назад +8

    Math visualized by a beautiful and elegant animation. That's why I love this channel.

  • @chrisd961
    @chrisd961 6 лет назад +27

    Yet again small coding challenge videos have won my heart :P

  • @captainalpha4853
    @captainalpha4853 6 лет назад +52

    This dude is a genius yall.

  • @SirajRaval
    @SirajRaval 6 лет назад +15

    Glad you met Simon as well! What a genius kid :D

  • @KristianPedersen
    @KristianPedersen 6 лет назад +5

    We love you with all our cardioids!

  • @beron_the_colossus
    @beron_the_colossus 6 лет назад +10

    Great video as always! Happy Valentines Day!

  • @paraglide01
    @paraglide01 6 лет назад +11

    Funny but your RUclips recommendations list is almost the same as mine. I love CodeBullet.

  • @dannorris1406
    @dannorris1406 6 лет назад +2

    Love this. It starts to look like a spinning sphere. Definitely going to try a few ideas out with it.

  • @sbkrish4356
    @sbkrish4356 6 лет назад

    Regularly I'm watching your videos. But today only subscribed to your channel. On Valentine's day my love goes to this.😍

  • @funguslars
    @funguslars 6 лет назад +3

    I love cool animations and visual tricks that have to do with math!

  • @SampleText7323
    @SampleText7323 5 лет назад +1

    Just saw this amazing video! Thanks for taking my suggestion, you made my day!

  • @bastianroling1430
    @bastianroling1430 6 лет назад

    This is by far the best video i've ever watched . Loved it

  • @Rockstard4
    @Rockstard4 5 лет назад

    It is one of the best videos I have seen.
    Loved it.

  • @Mortagus
    @Mortagus 6 лет назад +1

    The animation is just mesmerizing 😆

  • @djsyntic
    @djsyntic 2 года назад +1

    I liked how you linked the number of points to the mouse's X position. Might have been interesting to see that in conjunction with linking the factor to the mouse's Y position.

  • @heck0272
    @heck0272 6 лет назад

    Simply put, beautiful!

  • @zonetwelve5881
    @zonetwelve5881 6 лет назад

    I love processing and I love p5.js too
    Also your chanel, include you
    Happy Valentine's Day

  • @Manusmusic
    @Manusmusic 3 года назад

    I found this video because I am looking for more understanding on cardioids for painting project. Also inspired by Swedish painter Hilma Af Klint and her visions consisting the symbol. Your code created the most elegant animation, i love it. I feel like I have an idea for a tool for an artist but I don't have the understanding for the coding (Took one course of csharp in uni but don't remember much). I'd imagine the software having a adjustable slider with a reasonable gaps around the cardioid shape for example, it helps to visualize and trace the shapes.

  • @luce2988
    @luce2988 6 лет назад +1

    i had learned programming because of you :)

  • @grainfrizz
    @grainfrizz 6 лет назад +57

    16:24 - RIP RUclips compression

  • @ScorpioGameKing
    @ScorpioGameKing 6 лет назад +1

    This video got me to finally break down and work on translation maths of Python's tkinter module just so I could do this. Oh how I wish I wasn't to lazy to learn p5. It's not like this channel has a great series for learning it or anything. Still, great video!

    • @aaronrothwell7615
      @aaronrothwell7615 6 лет назад

      I tried a similar approach, with C#, but the problem is you end up looking for alternate ways of doing things, so you spend less time coding.When using P5/Processing you can follow along and just code at the same time.

  • @cobaltbluesky2276
    @cobaltbluesky2276 2 года назад

    Finally, I know why you see that heart shape pattern on the bottom of mugs and bowls!

  • @konstantinrebrov675
    @konstantinrebrov675 4 года назад

    I am simply astonished at how few lines of code you took to generate that graphics.
    I am contrasting to DirectX with C++ in which the boilerplate code to set everything up can be just as long.

  • @MathematicsOptimization
    @MathematicsOptimization 6 лет назад +55

    The thumbnail was flickering while I was scrolling, try it yourself

  • @siddhantjain2402
    @siddhantjain2402 6 лет назад +1

    This was gorgeous

  • @kaksisve4012
    @kaksisve4012 5 лет назад

    Thanks for tutorial! I've just made this with Haskell!

  • @prithviraj8801
    @prithviraj8801 4 года назад

    This is amazing loved it

  • @husamk3207
    @husamk3207 6 лет назад

    i love your content you always inspire me

  • @CodingWithUnity
    @CodingWithUnity 6 лет назад

    Oh man this video was awesome! Deff gotta try this in c# here soon

    • @CodingWithUnity
      @CodingWithUnity 6 лет назад +1

      Here's the webGL version of it i made with unity hahaha
      sniffle6.itch.io/animated-cardiod

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад

      Awesome, thanks for sharing!

  • @ishaanrastogi657
    @ishaanrastogi657 6 лет назад

    Lovely bro. You're a genius.

  • @stefomc1228
    @stefomc1228 6 лет назад +1

    Dude u are doing imposible i am so confused when i see that code. Great job u learned everything form that programming language i think is p5 js

  • @threeshot24
    @threeshot24 5 лет назад

    You are awesome!

  • @ahammedimtiaze
    @ahammedimtiaze 6 лет назад +1

    There are lots of videos and playlists in your channel. I have enjoyed much of your coding session and very interested to learn. Could you please say from where i should started learning from your channel as a beginner??

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад

      Try either of these playlists to start from scratch!
      ruclips.net/p/PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
      ruclips.net/user/shiffmanplaylists?view=50&shelf_id=2&sort=dd

  • @zantmelendez51
    @zantmelendez51 6 лет назад +1

    Can you make a video or link URLs to how to set up p5.js on visual studio code?

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад

      I did already! ruclips.net/p/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X

  • @JohannesHeld
    @JohannesHeld 6 лет назад

    That was awesome!

  • @eduardt7253
    @eduardt7253 6 лет назад

    You did it! Thank you

  • @marcoronzani7197
    @marcoronzani7197 6 лет назад

    I saw that shape in furier transform too, when the frequency drops to...i don’t remember ahah, however it is created wrapping a sinwave around a circle with each point on the circle rappresenting the angle (pi and so on) and the line connecting the point and the center long proportionally to the sine of that angle...or cosine...it doesn’t matter i think!

  • @dukestt
    @dukestt 5 лет назад

    Ive been messing with the numbers , the phase seems to be 100 or slighty more. If you change the factor number to 21, 26, 41, 49, 51, 61, 66, 68, 71, 89, 99, 100, 101 these are all pretty interesting with the points at 200

  • @knitpicky
    @knitpicky 4 года назад

    Hi! desperate student in need of help here.
    Lets say I wanted to add a conditional statement that, after the "factor" in this code goes above lets say 4, it goes back to 2 and then back to 4? thank you!!! I have a final due in a few days and I want to figure this out but im a bit lost.

  • @lovespictures2973
    @lovespictures2973 6 лет назад

    Beautiful!!

  • @coolbrotherf127
    @coolbrotherf127 6 лет назад

    I've actually never looked into the main use case for processing. What was the main reason it was developed and why does it have the specific features they wanted to have compared to other similar language packages.

    • @Ensivion
      @Ensivion 6 лет назад

      main function is where I do preliminary math and the draw loop I use to simply draw in a specific way. It's not important to use, but my style of programming uses it.

    • @coolbrotherf127
      @coolbrotherf127 6 лет назад

      @@Ensivion I don't think you understood what I was asking. I was asking why the Processing foundation developed Processing and the P5.js library.

  • @aataouimohamed6049
    @aataouimohamed6049 5 лет назад

    hii given ure a big lover of visualizing interesting maths, I suggest u take a look on the GABRIEL S HORN ( "there is an apparent paradox that the horn could be filled with a finite quantity of paint and yet that paint would not be sufficient to coat its inner surface.”)

    • @ffggddss
      @ffggddss 5 лет назад

      Rings a bell! That's a surface of revolution with a finite volume, but an infinite surface area (and infinite length), isn't it?
      Believe it's formed by rotating the graph of y = 1/x from 1 to ∞, about the x-axis.
      Fred

  • @HelloJollywood
    @HelloJollywood 6 лет назад +4

    *Awesome Sir* ☆☆

  • @giangtu5329
    @giangtu5329 5 лет назад +1

    Where do I start to learn math again in order to create any shape I want without looking up for formulars? This video is lovely, math and processing is sexy. I was the best in math back to highschool but now forgot everything. 😖

  • @ffggddss
    @ffggddss 5 лет назад

    That was stupendous!!!
    And now that you've done all your multiplication tables, what next?
    You could try some other kinds of functions to determine where to draw a line from each point on the circle.
    Quadratic or other polynomial; sine or cosine; log or exponential, ???
    You could use a non-circular ellipse instead of a circle, although that would just be a dilation of the circle case, in its simplest form.
    Or use some other closed curve ... not sure that would create anything interesting ...
    So is there any way this could be extended into 3 dimensions? Would we still be drawing lines? Or would they be planes?
    Fred

  • @nassav3
    @nassav3 6 лет назад

    So awesome!

  • @GodSpeaksInMath
    @GodSpeaksInMath 5 лет назад

    Genius Level... Mathologer as well...

  • @dukestt
    @dukestt 6 лет назад

    that is just fantastic

  • @matthewvicendese1896
    @matthewvicendese1896 6 лет назад

    You have been watching mathologer!! ... oh you just pointed it out! Come and visit Melbourne sometime.

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад

      Oh, I would love to! Never been to Australia. . .

  • @gonzalochristobal
    @gonzalochristobal 5 лет назад

    yo thanks for this man

  • @kingtarekdz
    @kingtarekdz 6 лет назад

    hello nice game with math and specially with the love day you makke the with number and have a magnefist meaning always the numbers have a secrets behind so cool video thank's for your work good night

  • @nomackleo
    @nomackleo 2 года назад

    Beautiful

  • @sham7742
    @sham7742 6 лет назад

    This all is so great and I really quite enjoy watching it but I have never done this kind of graphical programming before. I just wonder if there's any kind of javascript graphics course I can take so to get along with it as soon as I can.

    • @abird35
      @abird35 6 лет назад +1

      The videos in this channel are an excellent resource. Aside from that you just need a lot of Google and patience

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад +1

      Start here! ruclips.net/p/PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

    • @aaronrothwell7615
      @aaronrothwell7615 6 лет назад +1

      The great thing with P5 is it removes the need to do all the hard work in Javascript, so you just start doing the code in the videos, not worrying about a million other things that could go wrong. Sure more knowledge of Javascipt would be good, but just following some of these videos will teach you so much.

    • @sham7742
      @sham7742 6 лет назад

      Thank youuu so much

  • @slyer7695
    @slyer7695 6 лет назад +1

    I love that cute sun on your desktop 😂

  • @fre1253
    @fre1253 6 лет назад

    that was clean

  • @t.walker3101
    @t.walker3101 6 лет назад

    This was really cool gonna go try to code this up in java

  • @arturzyx
    @arturzyx 6 лет назад

    Uau! Que incrível! ✨

  • @PraveenKumar-mn2dm
    @PraveenKumar-mn2dm 6 лет назад

    This was really cool...…….Thank you!

  • @martinflores9611
    @martinflores9611 6 лет назад

    Great video amazing hello from México

  • @TheCalax
    @TheCalax 6 лет назад

    Why does adding PI to the angle invert the whole thing?

    • @aaronrothwell7615
      @aaronrothwell7615 6 лет назад

      In Processing the default for working with angles is radians, rather than degrees, which you may be more used to. A radian is 57.3 degrees, which multiplied by PI (3.14) is 180 degrees, which is half a circle, and so it rotates it around.

  • @Wigglemice
    @Wigglemice 5 лет назад

    Where can I find js code that I can edit.

    • @TheCodingTrain
      @TheCodingTrain  5 лет назад

      editor.p5js.org/codingtrain/sketches/gwcGb_NPm

  • @Ensivion
    @Ensivion 6 лет назад

    Hey I have a really cool animation of this concept that I'd like to publish somehow (in processing, I built my own from scratch), do you know what the best way to do that would be?

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад

      I would record it as a GIF or video file to share. Or convert it to p5.js so that you can run it in the browser!

  • @NikhoPrasetyoPratama
    @NikhoPrasetyoPratama 6 лет назад

    Love it!

  • @jakub7048
    @jakub7048 6 лет назад +6

    ME: could you hack NASA
    CODING TRAIN: Yea no problem

  • @arvindbabu2816
    @arvindbabu2816 3 года назад

    Could you please say which language you are using......

  • @rishuraj7273
    @rishuraj7273 6 лет назад

    Sir in my processing .... There is showing circle function does not exist

    • @borjonx
      @borjonx 6 лет назад

      Are you on version 3? www.processing.org/reference/circle_.html

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад

      It's only in the very latest Processing!

  • @pradeeshbm5558
    @pradeeshbm5558 6 лет назад

    This is amazing..

  • @SciencePlusPlus
    @SciencePlusPlus 6 лет назад

    What is this IDE??????

  • @arianrahman4840
    @arianrahman4840 6 лет назад +1

    dude's living life

  • @entyropy3262
    @entyropy3262 4 года назад

    What language is this ?
    Looks like AHK Syntax ?

  • @HyoukaStrb
    @HyoukaStrb 6 лет назад

    is it possible for me to learn this?
    im bad with math
    but can i know what books to or what math i can start ?

    • @_sander_
      @_sander_ 6 лет назад

      begin with watching the video of Big Shaq: Man's not hot

    • @HyoukaStrb
      @HyoukaStrb 6 лет назад

      @@_sander_ am i gonna learn for the scratch? i wanna go back to algebra again and so on and so forth
      i really look up people who can do advance math
      i think math is fun if you know ot

    • @BoJaN4464
      @BoJaN4464 6 лет назад

      Programming is a great way to learn math! Maybe start by making a simple asteroids type game in p5.js to learn how to deal with angles and vectors.
      I'm pretty sure coding train has a few beginner friendly videos as well as an asteroids video for you to start learning!

  • @tayyiptuzun1341
    @tayyiptuzun1341 4 года назад

    It's awesome,
    How can we turn this gcode?

  • @captainahab2518
    @captainahab2518 6 лет назад

    what would it look like if used prime numbers

  • @AleksHSE
    @AleksHSE 6 лет назад

    Made this modification to the coding challenge in p5.js. I hope you like it
    editor.p5js.org/AleksHSE/full/iU__Fza15

    • @AleksHSE
      @AleksHSE 6 лет назад

      My personal favorite is from factor 70-100

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад

      This is lovely! Please submit a link to the coding train website if you like!
      github.com/CodingTrain/website/wiki/Community-Contributions-Guide

  • @adityamaheshwari4764
    @adityamaheshwari4764 5 лет назад

    Any 'C' language version?

  • @WannesMalfait
    @WannesMalfait 6 лет назад

    I made this some time ago and posted it on my channel after watching that Mathologer video.

  • @xBrOwNeDoG
    @xBrOwNeDoG 6 лет назад

    Amazing

  • @WahranRai
    @WahranRai 5 лет назад

    Cardioid same root as cardiac , in french coeur (heart)

  • @elangkavinrajendran2842
    @elangkavinrajendran2842 6 лет назад

    How you learn to code like this dude!!!!!!!pls reply

  • @ebicer
    @ebicer 6 лет назад

    love it

  • @devi_buns
    @devi_buns 6 лет назад +3

    I mistakenly drew something similar trying to draw a circle using canvas animation

  • @ritikkothari2787
    @ritikkothari2787 6 лет назад

    which language is this??

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад

      This video uses Processing (which is built on top of the Java programming language). For more info, visit processing.org and also this video might help ruclips.net/video/AmlAiKsiy0o/видео.html.

  • @lucasmachadobueno563
    @lucasmachadobueno563 2 года назад

    Maravilhoso!

  • @bobbob1278
    @bobbob1278 5 лет назад

    Is this p5.js

    • @TheCodingTrain
      @TheCodingTrain  5 лет назад +1

      This video uses Processing (which is built on top of the Java programming language). For more info, visit processing.org and also this video might help ruclips.net/video/AmlAiKsiy0o/видео.html.

  • @zer001
    @zer001 6 лет назад

    Math in a good way!

  • @ゾカリクゾ
    @ゾカリクゾ 6 лет назад +2

    your youtube recommendations are (almost) identical to mine. isn't it cool?

  • @bikramchettri9405
    @bikramchettri9405 6 лет назад

    How to make a infinite div carousel

  • @vfx_jon
    @vfx_jon 5 лет назад

    I made a 3d dynamic model of this if you'd like to see?

  • @halasimov1362
    @halasimov1362 4 года назад

    Happy Feb 13th everybody! :D

  • @mariovelez578
    @mariovelez578 6 лет назад

    We did this in class as an activity for valentine's day in computer science

  • @chalkers
    @chalkers 6 лет назад

    It didn't feel like 17:20

  • @UniversityOfMassachusets
    @UniversityOfMassachusets 6 лет назад

    I have programmed in c++for 2 years now and after watching your videos, I really want to dive in to JavaScript. You make one of the funnest programs that I really want to do on my free time but I just cant on C++. Making this in C++ would be by far the hardest possible thing and you made it in 10 minutes using JavaScript. How long would it take to learn JavaScript and understanding the libraries? The code and syntax are somewhat similar to c++ but I think the most difficult part would be learning the libraries and implementing them the way you do. In a nut shell, I want to be able to write this code in a matter of an hour with just my understanding of JavaScript. How long you think it'll take to learn this for a person who will dedicate 4-5 hours a day?

    • @davidogutu9110
      @davidogutu9110 6 лет назад

      This is processing not c++. If you know c++ picking up js or processing should be relatively easy

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад +1

      Hi Hussein! This video uses Processing which is based on Java (!). I do a lot of JavaScript also on my channel mostly using the p5.js library. It's a good place to get started but if you are an experienced programmer in a different language you might want to investigate using JS without p5 for certain applications. Here is a playlist to get you started:
      ruclips.net/p/PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
      This workflow series might help also:
      ruclips.net/p/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X

  • @emiliathorsen9759
    @emiliathorsen9759 6 лет назад

    Wait what?! This dude plays rust?! Unexpected... 2:00

  • @realbingus
    @realbingus 6 лет назад +2

    This is the HTML5 Canvas version:
    window.onload = (() => {
    setupCanvas();
    });
    function setupCanvas() {
    window.requestAnimationFrame(animateCanvas);
    }
    var factor = 2;
    var TWO_PI = 2 * Math.PI;
    var circlePoints = 200;
    var increment = TWO_PI / circlePoints;
    var radius = 400;
    var hue = 0;
    function animateCanvas() {
    var canvas = document.getElementById("mainCanvas");
    var ctx = canvas.getContext("2d");
    var xOrigin = canvas.width / 2;
    var yOrigin = canvas.height / 2;
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    ctx.beginPath();
    ctx.strokeStyle = `HSL(${hue}, 100%, 50%)`;
    factor += 0.01;
    if (hue < 360) {
    hue++;
    } else {
    hue = 0;
    }
    for (var i = 0; i < circlePoints; i++) {
    var currentThing = i * increment;
    var currentX = radius * Math.sin(currentThing);
    var currentY = radius * Math.cos(currentThing);
    var targetThing = (i * factor * increment) % circlePoints;
    var targetX = radius * Math.sin(targetThing);
    var targetY = radius * Math.cos(targetThing);
    ctx.moveTo(xOrigin + currentX, yOrigin + currentY);
    ctx.lineTo(xOrigin + targetX, yOrigin + targetY);
    }
    ctx.stroke();
    requestAnimationFrame(animateCanvas);
    }

  • @xXPedoPanda42Xx
    @xXPedoPanda42Xx 6 лет назад

    💜

  • @plony6142
    @plony6142 5 лет назад

    Can someone make a clock from that, it would be amazing

  • @-._
    @-._ 6 лет назад

    RUclips compression just died at the end

  • @ahmedbadal3795
    @ahmedbadal3795 6 лет назад +1

    we need complete js for begginer series.. .plz make it (we need pure js ..not p5 or other .....
    thank you

  • @luce2988
    @luce2988 6 лет назад

    Valentines - Day

  • @ejonesss
    @ejonesss 6 лет назад

    you forgot to list the javascript version of the Cardioid you wrote in python in the video

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад

      All the code (including JS) can be found here! thecodingtrain.com/CodingChallenges/133-times-tables-cardioid.html