简体   繁体   中英

How to compare the orientation of a 3D vector against a plane in three dimensions

I am currently trying to plot a plane in three dimensional space but not sure how to do it for the problem I have.

Currently I have code that defines a 3D vector according to co-ordinates I have, this includes the ability to rotate, translate, and work out the angle between vectors.

The next step is to define a plane. I am not sure the best way to do this, however. The plane will be in a 100,100,100 box, be flat, and likely exist at az height of around 30.

My issue comes because I need this plane to do a couple of things:

1: I need to be able to rotate it around the three axes.

2: I need to be able to measure the smallest angle between the plane and the vector I have defined where the vector intersects the plane.

I was initially playing around trying to fill a numpy array with 1s where the plane would be etc but I don't see this really working how I need it to.

Does anyone know of any other tool that I would be able to use in this situation? Many thanks.

First of all, you'll need the normal vector to the plane. From there and following this link it should be easy for you to figure it out :)

Basically you get arcsin of the scalar product of your vector and the normal vector of the plane divided by the product of the norms of both vectors.

PS: If the plane is paralel to the XY plane, then it's normal vector it's just (0,0,1).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM