Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Coding Challenge

Автор: The Coding Train

Загружено: 2019-07-13

Просмотров: 162209

Описание:

In this coding challenge, I implement the “Gift Wrapping algorithm” (aka Jarvis march) for calculating a convex hull in JavaScript. This is a foundational topic in computational geometry! Code: https://thecodingtrain.com/challenges...

🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/s...

🎥 Previous video:    • Coding Challenge 147: Playing Chrome Dinos...  
🎥 Next video:    • Coding Challenge 149: Tic Tac Toe  
🎥 All videos:    • Coding Challenges  

References:
🌐 Gift Wrapping Algorithm: https://en.wikipedia.org/wiki/Gift_wr...
🌐 Cross Product: https://en.wikipedia.org/wiki/Cross_p...
📝 The splice() Array Function: https://developer.mozilla.org/en-US/d...

Videos:
🎥 ES6 Arrow Syntax:    • 16.3: ES6 Arrow Function - Topics of JavaS...  
🔴 Coding Train Live 180:    • Coding Train Live 180: Processing Java Lib...  

Timestamps:
00:00 Introduction
00:47 What is a Convex Hull?
02:36 The Gift Wrapping Algorithm
03:50 Animated Example of the Algorithm
04:58 Time Complexity of this Algorithm
05:30 Code! Drawing Random Points
05:42 Find the Leftmost Point
07:05 Set up Variables for the Animation
09:03 Make a Guess about the Next Point
10:58 Find out which Vector is “to the Left”
15:00 Add Spacing around the Points
15:33 Add an Exit Condition
15:54 Add the Next Vertex to the Hull
16:26 Draw the Hull
17:12 Continue the Algorithm with the Vertices
18:33 Check when the Algorithm is Done
19:08 Mutating the Array is not necessary
19:50 Watching the Algorithm with More Points
20:13 Inefficiencies about this Algorithm
20:29 Closing the Shape
20:54 (Gift) Wrapping up this Coding Challenge

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/pas...
🚩 Suggest Topics: https://github.com/CodingTrain/Sugges...
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter:   / thecodingtrain  
📸 Instagram:   / the.coding.train  

🎥 Coding Challenges:    • Coding Challenges  
🎥 Intro to Programming:    • Start learning here!  

🔗 p5.js: https://p5js.org
🔗 p5.js Web Editor: https://editor.p5js.org/
🔗 Processing: https://processing.org

📄 Code of Conduct: https://github.com/CodingTrain/Code-o...

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...

#algorithm #computationalgeometry #convexhull #p5js #javascript

Coding Challenge

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Coding Challenge 149: Tic Tac Toe

Coding Challenge 149: Tic Tac Toe

Алгоритм выпуклой оболочки — учебник по сканированию Грэма и алгоритму Джарвиса Марча

Алгоритм выпуклой оболочки — учебник по сканированию Грэма и алгоритму Джарвиса Марча

Coding Challenge #139: Calculating Digits of Pi with Collisions

Coding Challenge #139: Calculating Digits of Pi with Collisions

Coding Challenge 143: Quicksort Visualization

Coding Challenge 143: Quicksort Visualization

Программирование на ассемблере без операционной системы

Программирование на ассемблере без операционной системы

Convex Hull in 3D

Convex Hull in 3D

Как Сделать Настольный ЭЛЕКТРОЭРОЗИОННЫЙ Станок?

Как Сделать Настольный ЭЛЕКТРОЭРОЗИОННЫЙ Станок?

Coding Challenge #136.1: Polar Perlin Noise Loops

Coding Challenge #136.1: Polar Perlin Noise Loops

Графический API не имеет значения

Графический API не имеет значения

Загадка, в которую невозможно поверить, даже если знаешь ответ [Veritasium]

Загадка, в которую невозможно поверить, даже если знаешь ответ [Veritasium]

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

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

Теренс Тао о том, как Григорий Перельман решил гипотезу Пуанкаре | Лекс Фридман

Теренс Тао о том, как Григорий Перельман решил гипотезу Пуанкаре | Лекс Фридман

Coding Challenge 185: Unfolding Fractals

Coding Challenge 185: Unfolding Fractals

🧪🧪🧪🧪Как увидеть гиперпространство (4-е измерение)

🧪🧪🧪🧪Как увидеть гиперпространство (4-е измерение)

🔥 Собрал МОЩНЕЙШИЙ РЕКУПЕРАТОР своими руками

🔥 Собрал МОЩНЕЙШИЙ РЕКУПЕРАТОР своими руками

Самая сложная задача на самом сложном тесте

Самая сложная задача на самом сложном тесте

Turning Images into Dots: The Magic of Dithering

Turning Images into Dots: The Magic of Dithering

How to lie using visual proofs

How to lie using visual proofs

Convex hulls: Graham scan - Inside code

Convex hulls: Graham scan - Inside code

31 портал невозможной формы

31 портал невозможной формы

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]