mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-22 04:42:10 +08:00
Documentation for 95ed72a452
This commit is contained in:
@@ -136,7 +136,7 @@ Functions</h2></td></tr>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p >Implementation of <a href="https://en.wikipedia.org/wiki/Gift_wrapping_algorithm" target="_blank">Jarvis’s</a> algorithm. </p>
|
||||
<p >Given a set of points in the plane. the convex hull of the set is the smallest convex polygon that contains all the points of it.</p>
|
||||
<h3><a class="anchor" id="autotoc_md66"></a>
|
||||
<h3><a class="anchor" id="autotoc_md67"></a>
|
||||
Algorithm</h3>
|
||||
<p >The idea of Jarvis’s Algorithm is simple, we start from the leftmost point (or point with minimum x coordinate value) and we keep wrapping points in counterclockwise direction.</p>
|
||||
<p >The idea is to use orientation() here. Next point is selected as the point that beats all other points at counterclockwise orientation, i.e., next point is q if for any other point r, we have “orientation(p, q, r) = counterclockwise”.</p>
|
||||
|
||||
Reference in New Issue
Block a user