我如何才能知道,如果点在三角吗? [英] How can I find out if point is in triangle?

查看:146
本文介绍了我如何才能知道,如果点在三角吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种算法(3D),这将确定是否点属于一个三角形。并且,如果它确实我想知道在三角形一些点和另一点之间的距离。三角形可以稍微转动,但是,如果点以外三角形垂直到达那么它不应该被视为三角形内

I need an algorithm (3D), which would determine if point belongs to a triangle. And also if it does I want to know the distance between some point in triangle and a another point. Triangles can be slightly rotated, but if point is outside triangles vertical reach then it should not be considered as inside the triangle.

现在我意识到,我的问题可能不会作出很大的意义所以这里的图片,这也解释了我想要的。

Now I realize, my question probably doesn't make a lot of sense so here's the picture, which explains what I want.

灰色线条显示,哪种方式三角实际上是面临着。

Grey lines display, which way triangle is actually facing.

推荐答案

这似乎是3D相当于<一href="http://stackoverflow.com/questions/8328511/data-structure-to-query-points-which-lie-inside-a-triangle/8328673#8328673">Data结构要查询的谎言三角形内点。 可以在3D用同样的方法:在3D,一个平面切割空间分成两半:一个点可以是在平面的一侧或在另一侧。该楔形是飞机的集合:刚才结合which_side_of_the_plane信息给定点与全部建立了楔形平面

This seems like the 3D equivalent of Data structure to query points which lie inside a triangle. You could use the same method in 3D: in 3D, a plane cuts the space in two halves: a point is either at one side of the plane or at the other side. The wedge-shape is a collection of planes: just combine the which_side_of_the_plane information for a given point with all the planes that build up the wedge.

这篇关于我如何才能知道,如果点在三角吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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