Intermediate Python Tutorial | Gravitational Slingshot Simulation

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

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

  • @TechWithTim
    @TechWithTim  Год назад +8

    Sign up for my FREE Software Development Introduction course here: techwithtim.net/dev - this it the best resource to actually land a job and network with a group of like minded developers 💪

  • @tuekhang11
    @tuekhang11 Год назад +7

    I really like the way you integrate coding with physics. This is very interesting! Hope you will create more tutorial videos about physics simulation in coding. I also really love the cell simulation you made several weeks ago!

  • @gregf9160
    @gregf9160 Год назад +8

    MASTERCLASS!

  • @plinketharry7469
    @plinketharry7469 Год назад +2

    Dude this was perfect, Im loving the mix of physics in with coding lessons. Would be cool to see a build with multiple planets. Also these hourish long tutorials are the perfect length and skill level for me right now so thats super helpful.

  • @kapibara2440
    @kapibara2440 24 дня назад

    That was an awesome project to observe. Thank you for that 👏👏👏❤

  • @juliacoggins7292
    @juliacoggins7292 Год назад +1

    Hey Tim, very cool project. As a theoretical physics graduate, I really appreciate it!

  • @Jackson141vja
    @Jackson141vja Год назад

    I have been watching your tutorials for while now and I really like this type of videos! keep it up!

  • @fudgenuggets405
    @fudgenuggets405 Год назад

    These are my favorite videos. I would like to see more physics simulators. Maybe something that draws out lines of magnetism to get away from classical mechanics and delve into electrodynamics.

  • @MyriadColorsCM
    @MyriadColorsCM Год назад

    That was a great tutorial, and easier than I thought it would be.
    Im working on a fork of the project, im trying to implement a path prediction for the object before the player clicks.

  • @schielkemusic
    @schielkemusic Год назад

    Very well made tutorial, im just starting out in python knowing only the basics and learned very much here, thank you!

  • @timbeard8457
    @timbeard8457 10 месяцев назад

    Super video. Have saved the link to be able to use it as a reference. Just what I've been looking for. I wanted to practice some object-oriented coding in Python based on physics simulations (I love the maths stuff!) I wasn't sure which graphics library to use, so this was an excellent intro to pygame. Looks pretty straightforward.
    One thought about the acceleration calculation: couldn't you simply calculate the distances, force and acceleration separately in the x and y directions? They you could avoid all the Pythagoras and trig calculations. I'm pretty sure I'm correct here, but haven't checked the maths yet.

  • @samukaze5810
    @samukaze5810 2 месяца назад

    Best tutorial out there

  • @esrx7a
    @esrx7a Год назад

    Nice physics, thank you Tim
    Hey, thanks for bringing up the sponsor of this video, that which I wanted to know about

  • @winzerprince222
    @winzerprince222 8 месяцев назад +1

    If you make the planet size like 350 you can make the spacecraft enter the planet's orbit depending on how you launch it

  • @JorgeEscobarMX
    @JorgeEscobarMX Год назад +1

    Listening to this while I'm playing elite dangerous and I can say that the sling shot effect is a thing while you travel at 100c near a planet.

  • @OG22812
    @OG22812 Год назад

    Bruv u don’t need to watch the whole video, only the idea of the this project is amazing

  • @gregorybuser
    @gregorybuser Год назад

    I LOVE the video, it’s probably one of the very best I’ve ever seen and I’ve watched thousands.
    My physics is no better than my Python, but it seems to me like all the messing around with trigonometry was unnecessary: given the distance A with x, y components being the x and y distances, wouldnt the force vector A have x and y components in equal proportion to x and y distance? No solving for theta required?

  • @paulthomas1052
    @paulthomas1052 Год назад

    Great simulation - thanks !

  • @darrenselvage6972
    @darrenselvage6972 Год назад

    This is a nice programming exercise; but this is not the classical "slingshot maneuver" that was used by spacecraft like the Voyager probes to increase their speed. If the field were larger, the object would either reach escape velocity but be moving slower than when it started or would fail to escape the gravity well, would ultimately crash back into the planet or (if you were very lucky with your vector) establish a stable orbit. The slingshot maneuver, or gravity assist, used to accelerate a spacecraft only works if you simulate the motion of the planetary body. I would call this more of a gravity well simulation. If you want more information, check out the Wikipedia Gravity Assist page. Still a cool exercise.

  • @X-razcal-X
    @X-razcal-X Год назад

    Nice. Thanks Tim 🎉

  • @garrettsmith315
    @garrettsmith315 Год назад

    looks like you've been hitting the gym too ! Great stuff can't wait to try out the course!
    Been revisiting a lot of your Flask material lately, I find myself needing an update.....

  • @JorgeEscobarMX
    @JorgeEscobarMX Год назад

    My favorite video so far🎉

  • @ananthraj9386
    @ananthraj9386 Год назад

    Epic 👏👏

  • @48_subhambanerjee22
    @48_subhambanerjee22 Год назад

    Amazinggg ☠️☠️💀💀. You sre python god

  • @fabiokido
    @fabiokido Год назад +2

    The video reminded me of Angry Birds Star Wars!

  • @johnnytoobad7785
    @johnnytoobad7785 Год назад

    This is a great simulation project to see how objects work in "real time".
    However I think there is some confusion in the last section.
    Your are adding components of an acceleration vector to obtain a velocity vector and then sum the components of a velocity vector
    to obtain a position vector. Every time you perform an "ADD" operation in "move" you essentially drop a physical dimension d/s2 -> d/s -> d.
    So your essentially summing apples, oranges and pears.
    I see it working... but those "vector" additions would fail a physics exam since all the vectors discussed have a different set of units.
    Each "time slice" of the simulation changes only the relative x&y positions of the ship.

    • @fudgenuggets405
      @fudgenuggets405 Год назад

      It works for this simulation if you think of each frame refresh as simulating one second (assuming acceleration and velocity are in "per sec^2 and per sec units). If each refresh is assumed to represent one second then you are multiplying acceleration by one second to get velocity and multiplying velocity by one second to get position. Obviously you don't have to type out * 1 sec in the equations.

    • @timbeard8457
      @timbeard8457 10 месяцев назад

      I'm definitely a big fan of pedantry and you are correct, but I think for this coding demo, it is sufficient. One could have calculated real sizes, masses, distances and speeds, but that would have been unnecessarily complicated and a tad boring without adding an acceleration factor.

  • @BeginnersCoding92
    @BeginnersCoding92 Год назад

    Amazing Explanation :)

  • @ag88301
    @ag88301 Год назад +1

    he should make a tutorial on reimplementing the collision system to take into account the roche limit of the planet and eventually make it into a whole spacecraft game lol

  • @kengounited
    @kengounited Год назад

    Get the initial velocity vector point toward earth's center and you're gonna get a blowup in finite time :-)

  • @rverm1000
    @rverm1000 Год назад

    can you add a change in color to the object based on speed.. great video, that is the stage i need to advance to next.

  • @zackzellto4403
    @zackzellto4403 Год назад +3

    Tim, I have always wondered and it always makes me feel so far behind lol, but do people just know what to build right off their mind or what type or research is done for this type of project? Do you follow a tutorial or course to build? Do you have to look up much in order to build it?

    • @jesuschris9543
      @jesuschris9543 Год назад +2

      If you know the math, and know how to read documentation, and have a solid under of object oriented programming, iit’s pretty easy

    • @TheLukasBer
      @TheLukasBer Год назад +1

      He's probably reading the code in another screen while he codes along. To make the first code it probably took him some time too. It's not that simple to just think about this project and code all of that while explaining with no mistakes.

  • @dupadupa8371
    @dupadupa8371 Год назад +3

    Tim, what vsc theme are u using? :>

    • @Kauieee
      @Kauieee Год назад +1

      Monokai

    • @numbah16
      @numbah16 Год назад

      @@Kauieee All Hail!

  • @moritzdeiaco2798
    @moritzdeiaco2798 Год назад

    Nice one

  • @faizi2895
    @faizi2895 Год назад

    Please cover these django topics
    how to enter multiple entries in database, signals,
    How to use pagination, data table, jwt token and rest ful apis

  • @oleng5398
    @oleng5398 Год назад

    Thats cool

  • @anzarrabbani3766
    @anzarrabbani3766 Год назад

    35:07 im getting sort of a glitch when i make a bunch of objects i get a huge red line on my screen anyone know why

  • @TheBenchPressBoss
    @TheBenchPressBoss Год назад

    Hey tim, When i try to import sys on pycharm why wont it allow me to add it to the python interpreter?

  • @popel_
    @popel_ Год назад

    How do you like the idea of creating a course on Django 4.2?

  • @nassosdimou3337
    @nassosdimou3337 Год назад

    Hey mojo is out, will you make a tutorial in what it can do?

  • @carzetonao
    @carzetonao Год назад

    Smart

  • @shaniceervin1465
    @shaniceervin1465 Год назад

    Does it matter which one I pick between course careers and programming expert? I can go to college but the only problem is I just found out that Covid and I really don’t get along well haha so I have to avoid the virus if possible. Hopefully find a remote Job but if I have to go into an office I’ll just wear a good mask and pray.

  • @alperklc7782
    @alperklc7782 2 месяца назад

    thanks tanks thanks :=)

  • @Global_Reality-bcn
    @Global_Reality-bcn Год назад

    could you please make a video on Tic-Tac-Toe AI 🙏🙏

  • @joaovisto
    @joaovisto Год назад

    I just watched the solar system video yesterday

  • @Participant616
    @Participant616 Год назад

    Get some sunlight Tim.

  • @koalakid3609
    @koalakid3609 23 дня назад

    SOHCAHTOH is what i got tought in school lol

  • @ChristopherBruns-o7o
    @ChristopherBruns-o7o 11 месяцев назад

    Lol better at coding then spelling... Bahaha i have the same problem when surfing the web and reading!!!

  • @jabirmustafasulaiman5147
    @jabirmustafasulaiman5147 Год назад

    How many years take to become intermedia programmer

  • @george_papal4930
    @george_papal4930 Год назад +1

    where is the project on github? Can anyone sent a ling

    • @TechWithTim
      @TechWithTim  Год назад

      github.com/techwithtim/Slingshot-Effect-Simulation

  • @palashjyotiborah9888
    @palashjyotiborah9888 Год назад +2

    Sponsored by Myself. 😅😅😅😂🎉

  • @vmartme
    @vmartme 11 месяцев назад

    Really weird I made the same game last summer in my free time :D But my is little beter (have more option) :P lol

  • @nobdysus8326
    @nobdysus8326 Год назад +1

    first

  • @TawanaChingarande
    @TawanaChingarande Год назад

    how does bro not know how to spell gravitational