覆盖的点云带有R区 [英] Area covered by a point cloud with R

查看:187
本文介绍了覆盖的点云带有R区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个云散在2D欧氏空间中的点。我想计算多边形连接云的最极端的(=外设)点内的区域。换句话说,我想估计涵盖了云计算这个领域的区域。 有没有在研发公式? 非常感谢任何反应 朱利安

I have a cloud of points scattered in a 2D Euclidean space. I would like to calculate the area inside the polygon linking the most extreme (=peripheral) points of the cloud. In other words, I would like to estimate the area covered by the cloud in this space. Is there a formula in R? Thanks a lot for any response Julien

推荐答案

这就是所谓的凸包问题; - [R内置 chull 函数应该做的工作。要计算面积,您可以使用从公式这里

This is called the convex-hull problem; R built-in chull function should do the work. To count area, you may use a formula from here.

编辑:更妙的; splancs 包有 areapl 功能。因此,功能解决你的问题应该是这样的:

Even better; splancs package has areapl function. So the function solving your problem should look like this:

cha<-function(x,y){
chull(x,y)->i
return(areapl(cbind(x[i],y[i])))
}

例如:

library(splancs);
x<-rnorm(20);rnorm(20)->y;
#Some visualization
i<-chull(x,y);plot(x,y);polygon(x[i],y[i]);
#The area
cha(x,y);

这篇关于覆盖的点云带有R区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆