# Re: [MORPHMET] % of overlap of convex hulls in 2D scatterplots

Andrea,

There are two ways to do this, one precise and one less precise.  The less
precise method is to calculate the convex hull areas of three hulls: the two of
interest and one comprising the points of both. Subtract the total area of the
comprehensive hull from the sum of the two groups hulls, then divide by area of
the comprehensive hull. This ratio will tell you how much of one hull split in
two will overlap compared to the area of one single hull.

The more precise method is to determine the points shared in common by two
hulls and calculate the convex hull area of this set, which can then be divided
by the area found as the sum of the two separate hulls minus this overlap area.

The difficulty would be detecting points that occur within bounds
automatically. An algorithm can be used to ask if a point, when added to hull
points, changes the hull area. If yes, it exists outside the hull; if no, it
must occur within the hull boundaries. Points that change neither hull areas
are found within the boundaries of both, thus the region of overlap. Running
such an algorithm on every point in a data set will determine the shared
points.

Have fun!
Mike

Sent from my iPhone

> On Aug 21, 2018, at 6:29 PM, alcardini <alcard...@gmail.com> wrote:
>
> Dear All,
> please, does anyone know if there's an R script or package to compute
> the exact % of overlap of convex hulls in 2D scatterplots?
> I found something but was developed for high dimensional spaces and
> seems to compute that using an approximation. In 2D it should not be
> too difficult to get the exact %, I guess.
>
> Thanks a lot in advance.
> Cheers
>
> Andrea
>
>
>
> --
>
> Dr. Andrea Cardini
> Researcher, Dipartimento di Scienze Chimiche e Geologiche, Università
> di Modena e Reggio Emilia, Via Campi, 103 - 41125 Modena - Italy
> tel. 0039 059 2058472
>
> Adjunct Associate Professor, School of Anatomy, Physiology and Human
> Biology, The University of Western Australia, 35 Stirling Highway,
> Crawley WA 6009, Australia
>
>
> FREE Yellow BOOK on Geometric Morphometrics:
> http://www.italian-journal-of-mammalogy.it/public/journals/3/issue_241_complete_100.pdf
>
> http://www.footprintnetwork.org/en/index.php/GFN/page/calculators/
>
> --
> MORPHMET may be accessed via its webpage at http://www.morphometrics.org
> ---
> You received this message because you are subscribed to the Google Groups
> "MORPHMET" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to morphmet+unsubscr...@morphometrics.org.
>

--
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
---
You received this message because you are subscribed to the Google Groups
"MORPHMET" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to morphmet+unsubscr...@morphometrics.org.