3D系列平面交叉口 [英] 3D Line-Plane Intersection

查看:251
本文介绍了3D系列平面交叉口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果给定一个线(重$ P $用向量或就行了两点psented)如何找到在该线相交平面的点?我发现的资源负载上,但我不明白的方程有(他们似乎并没有被标准的代数)。我想一个方程式(无论多长时间),可以通过标准的编程语言(我使用的Java)。

If given a line (represented by either a vector or two points on the line) how do I find the point at which the line intersects a plane? I've found loads of resources on this but I can't understand the equations there (they don't seem to be standard algebraic). I would like an equation (no matter how long) that can be interpreted by a standard programming language (I'm using Java).

推荐答案

您需要考虑三种情况:

  • 在平面平行于行,行不在于平面(不相交)
  • 面不平行于线(1交点)
  • 平面包含行(线相交于它的每一个点)

您可以EX preSS的线paramaterized形式,喜欢这里:

You can express the line in paramaterized form, like here:

<一个href="http://answers.yahoo.com/question/index?qid=20080830195656AA3aEBr">http://answers.yahoo.com/question/index?qid=20080830195656AA3aEBr

本次讲座的前几页的飞机做同样的:

The first few pages of this lecture do the same for the plane:

<一个href="http://math.mit.edu/classes/18.02/notes/lecture5compl-09.pdf">http://math.mit.edu/classes/18.02/notes/lecture5compl-09.pdf

如果在垂直于平面垂直于沿线的方向,那么你有优势的情况下,需要看它是否相交可言,或位于该平面内。

If the normal to the plane is perpendicular to the direction along the line, then you have an edge case and need to see whether it intersects at all, or lies within the plane.

否则,有一个交点,并能解决它。

Otherwise, you have one point of intersection, and can solve for it.

我知道这是不是code,但得到你可能希望把它放到你的应用程序的背景下强大的解决方案。

I know this isn't code but to get a robust solution you'll probably want to put this in the context of your application.

编辑:下面是一个例子其中有只有一个交点。说你开始的第一个环节的参数方程:

Here's an example for which there's exactly one point of intersection. Say you start with the parameterized equations in the first link:

x = 5 - 13t
y = 5 - 11t
z = 5 - 8t

参数 T 可以是任何东西。在(无限)集合中的所有的(X,Y,Z)满足这些方程构成线。然后,如果你有方程的飞机,说:

The parameter t can be anything. The (infinite) set of all (x, y, z) that satisfy these equations comprise the line. Then, if you have the equation for a plane, say:

x + 2y + 2z = 5

(取自这里)可以替代方程为 X 以Z 上面入式对于飞机,这是目前仅在参数 T 。求解 T 。这是 T 该行位于飞机上的特殊价值。然后,您可以解 X 以Z 通过返回到线方程和代 T 回来

(taken from here) you can substitute the equations for x, y, and z above into the equation for the plane, which is now in only the parameter t. Solve for t. This is the particular value of t for that line that lies in the plane. Then you can solve for x, y, and z by going back up to the line equations and substituting t back in.

这篇关于3D系列平面交叉口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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