Convex hulls: Jarvis march algorithm (gift-wrapping) - Inside code

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024
  • Source code: gist.github.co...
    🔴 Learn graph theory algorithms: inscod.com/gra...
    ⚙ Learn dynamic programming: inscod.com/dp_...
    💡 Learn to solve popular coding interview problems: inscod.com/50p...
    ⌛ Learn time and space complexity analysis: inscod.com/com...
    🔁 Learn recursion: inscod.com/rec...
    NB: This video is ad-free, you can choose to support Inside code by purchasing one of the courses above or dropping a super thanks!
    NB2: Discounts of courses above are permanent
    I also post content on LinkedIn (inscod.com/lin...) and Instagram (inscod.com/ins...)

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

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

    I can't understand why in the while True loop, each time we set next_point = points[0] , I mean logically this is not correct because how can be each time to get the next point to be the first one point
    and also what if the first point is also the min point ? (meaning the leftmost)

  • @ivansantibanezkoref8204
    @ivansantibanezkoref8204 Год назад +4

    In 7:40-7:56 there is a error in the comparison symbols (CCW and CW).

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

      It is right, you can also verify it via cross product of two vectors

    • @yoguypro8804
      @yoguypro8804 Месяц назад

      @@Ash_538 no its wrong beacause they both say >0 which means the same condition gives clockwise and counter-clockwise

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

    I need to learn math... I like how you changed an equation of divisions to all multiplication

  • @minarefaat1573
    @minarefaat1573 2 года назад +2

    Amazing content with amazing animation as usual.
    Is there any courses you recommend to learn how to make animation like that.

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

      Hello, thanks for the comment!
      And for animation, I didn't take a course, you just need to know the features of your software (PowerPoint for my case) and knowing how to express an idea visually

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

    Thanks a lot for the explanation, it works like a charm 🍺

  • @cupatelj
    @cupatelj 2 года назад +2

    Excellent video, as always.

  • @SAKSHAMBAJAJ-cw1tb
    @SAKSHAMBAJAJ-cw1tb 5 месяцев назад +1

    Hi, How did you visualise the algorithm, did you code it somehow

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

    Try making a video about the "Munkres Assignment" ("Hungarian") algorithm with this kind of animation.

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

    Awesome bro

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

    My question is how to generate a cloud of point in a closed shape. Points are not romdom, but controlled. Can you help me

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

    what if we want to include all collinear points? what should be the condition inside if(?)

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

    Awesome!!, thanks for making this video :) which software do you use to make these videos?

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

      You're welcome!
      PowerPoint + Camtasia

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

    So, it seems like this explanation and your code implement the algorithm differently than the explanations I find on
    Wikipedia: en.wikipedia.org/wiki/Gift_wrapping_algorithm
    and this other video: ruclips.net/video/B2AJoQSZf4M/видео.html
    These explanations seem to be trying to find the smallest counterclockwise angle, whereas in your code and explanation you seem to only deal with 3 options, clockwise, collinear, and counterclockwise (1, 0, -1), right?
    Do you see this too? Or am I not understanding this properly. It seems that the algorithms sorta do fundamentally the same thing, but in noticeably different ways.

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

      It's weird because to implement the algorithm I worked with the pseudocode of the Wikipedia article

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

      @@insidecode okay, but you have the marchMinAngle() function too. did that work for you?
      i write one that worked for me and think I finished it yesterday (along with graham scan and a nice visualization).

  • @aditya-st1sv
    @aditya-st1sv 2 года назад

    Provide source code in c++

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

      I don't have it, but you can search for Jarvis match C++ on Internet