开发者

Calculate a Vector that lies on a 3D Plane

I have a 3D Plane defined by two 3D Vectors:

  • P = a Point which lies on the Plane
  • N = The Plane's surface Normal

And I want to calculate any vector tha开发者_运维知识库t lies on the plane.


Take any vector, v, not parallel to N, its vector cross product with N ( w1 = v x N ) is a vector that is parallel to the plane.

You can also take w2 = v - N (v.N)/(N.N) which is the projection of v into plane.

A point in the plane can then be given by x = P + a w, In fact all points in the plane can be expressed as x = P + a w2 + b ( w2 x N ) So long as the v from which w2 is "suitable".. cant remember the exact conditions and too lazy to work it out ;)

If you want to determine if a point lies in the plane rather than find a point in the plane, you can use

x.N = P.N

for all x in the plane.


If N = (xn, yn, zn) and P = (xp, yp, zp), then the plane's equation is given by:

(x-xp, y-yp, z-zp) * (xn, yn, zn) = 0

where (x, y, z) is any point of the plane and * denotes the inner product.


And I want to calculate any vector that lies on the plane.

If I understand correctly You need to check if point belongs to the plane?

http://en.wikipedia.org/wiki/Plane_%28geometry%29

You mast check if this equation: nx(x − x0) + ny(y − y0) + nz(z − z0) = 0 is true for your point.

where: [nx,ny,nz] is normal vector,[x0,y0,z0] is given point, [x,y,z] is point you are checking.

//edit Now I'm understand Your question. You need two linearly independent vectors that are the planes base. Sow You need to fallow Michael Anderson answerer but you must add second vector and use combination of that vectors. More: http://en.wikipedia.org/wiki/Basis_%28linear_algebra%29

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜