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...)
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)
In 7:40-7:56 there is a error in the comparison symbols (CCW and CW).
It is right, you can also verify it via cross product of two vectors
@@Ash_538 no its wrong beacause they both say >0 which means the same condition gives clockwise and counter-clockwise
I need to learn math... I like how you changed an equation of divisions to all multiplication
Amazing content with amazing animation as usual.
Is there any courses you recommend to learn how to make animation like that.
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
Thanks a lot for the explanation, it works like a charm 🍺
Excellent video, as always.
Thanks!
Hi, How did you visualise the algorithm, did you code it somehow
Try making a video about the "Munkres Assignment" ("Hungarian") algorithm with this kind of animation.
Interesting suggestion
Awesome bro
My question is how to generate a cloud of point in a closed shape. Points are not romdom, but controlled. Can you help me
what if we want to include all collinear points? what should be the condition inside if(?)
Awesome!!, thanks for making this video :) which software do you use to make these videos?
You're welcome!
PowerPoint + Camtasia
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.
It's weird because to implement the algorithm I worked with the pseudocode of the Wikipedia article
@@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).
Provide source code in c++
I don't have it, but you can search for Jarvis match C++ on Internet