Discussion:
[R] Is xyz point inside 3d convex hull?
Camilo Mora
2014-10-12 20:20:42 UTC
Permalink
Hi everyone,

I wonder if there is a code in r that can generate a 3d convex hull from a data-frame containing 3 columns and then use another database with the same three columns and for each row determine if the xyz point is inside or not the convex hull generated with the first database?

The package geometry allows to calculate a hull and it's volume. I was planning to calculate the volume of the convex hull after adding each point in the second database and if the hull gets bigger then the point is out and if not then the point is in. A problem with this method is that I have over 10 million points and the calculation for each point will take a lot of time.

Any guidance will be greatly appreciated,

Thanks,

Camilo

[[alternative HTML version deleted]]
Don McKenzie
2014-10-12 20:24:25 UTC
Permalink
Check the R-news archive with approrpriate keywords. There was a long exchange awhile back when I asked a similar question.
Post by Camilo Mora
Hi everyone,
I wonder if there is a code in r that can generate a 3d convex hull from a data-frame containing 3 columns and then use another database with the same three columns and for each row determine if the xyz point is inside or not the convex hull generated with the first database?
The package geometry allows to calculate a hull and it's volume. I was planning to calculate the volume of the convex hull after adding each point in the second database and if the hull gets bigger then the point is out and if not then the point is in. A problem with this method is that I have over 10 million points and the calculation for each point will take a lot of time.
Any guidance will be greatly appreciated,
Thanks,
Camilo
[[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Don McKenzie
Research Ecologist
Pacific Wildland Fire Sciences Lab
US Forest Service

Affiliate Professor
School of Environmental and Forest Sciences
University of Washington
dmck at uw.edu
Keith Jewell
2014-10-13 08:25:16 UTC
Permalink
Back in 2009 I posted some code to this list, see:
<http://tolstoy.newcastle.edu.au/R/e8/help/09/12/8784.html>

I submitted the function 'inhull' to the geometry package maintainer,
but I don't think it was ever included.

HTH

Keith J
Post by Don McKenzie
Check the R-news archive with approrpriate keywords. There was a long exchange awhile back when I asked a similar question.
Post by Camilo Mora
Hi everyone,
I wonder if there is a code in r that can generate a 3d convex hull from a data-frame containing 3 columns and then use another database with the same three columns and for each row determine if the xyz point is inside or not the convex hull generated with the first database?
The package geometry allows to calculate a hull and it's volume. I was planning to calculate the volume of the convex hull after adding each point in the second database and if the hull gets bigger then the point is out and if not then the point is in. A problem with this method is that I have over 10 million points and the calculation for each point will take a lot of time.
Any guidance will be greatly appreciated,
Thanks,
Camilo
[[alternative HTML version deleted]]
Loading...