# Thread: One vector on a tangent plane

1. ## One vector on a tangent plane

This is my first post here, so hello all.

I'm not sure whether this counts as 'advanced geometry', but here goes.

Between two 3D objects (assume they are spherical), there lies a tangent plane. I need to find any one vector that falls on the tangent plane, other than [0,0,0].

This is for a 3D application, so the time taken to run any calculations used is important. I need to find an arbitrary vector perpendicular to the (known) normal between two points, and parallel with the tangent plane; that is probably a better description than a vector that falls on the tangent plane.

In 2D, this can be done by swapping the components of the known normal, and multiplying one of them by -1.. Is there a similar 'quick' method for 3D?

I am more of a programmer than a mathemetician; and most information I have found uses terminology I don't fully understand. I'd prefer an explanation of a suitable method that I can understand rather than an answer.

2. Originally Posted by MattEvans
This is my first post here, so hello all.

I'm not sure whether this counts as 'advanced geometry', but here goes.

Between two 3D objects (assume they are spherical), there lies a tangent plane. I need to find any one vector that falls on the tangent plane, other than [0,0,0].

This is for a 3D application, so the time taken to run any calculations used is important. I need to find an arbitrary vector perpendicular to the (known) normal between two points, and parallel with the tangent plane; that is probably a better description than a vector that falls on the tangent plane.

In 2D, this can be done by swapping the components of the known normal, and multiplying one of them by -1.. Is there a similar 'quick' method for 3D?

I am more of a programmer than a mathemetician; and most information I have found uses terminology I don't fully understand. I'd prefer an explanation of a suitable method that I can understand rather than an answer.

If you know the Normal vector (N) , then a vector perpendicular (p) to this will be in the plane and will satisfy
N (dot) p = 0
where (dot) is the dot product.

Nx*px + Ny*py + Nz*pz = 0

If you need to have one at a glance, try p = (0, Nz, -Ny)

-Dan

(Note: The reason your procedure works in 2D is that:
p = (Nx, -Ny) ==> Nx*(-Ny) + Ny*(Nx) = 0
It's the same principle.)

3. Thanks, that seems to work correctly.

Getting the tangent vector wrong in this application doesn't have an obvious immediate effect, nor is it visualizable; but it does eventually destablize the system (testing 3D elastic collisions graphically). With the values you gave, I have sustained stability.

With the methods I was trying, I was attempting to 'preserve' some relation to the x,y, and z from the normal in some way, I ended up focusing on always trying to get a perpendicular that was the same 90 degree rotation of the normal along a, pretty much unquantifiable, axis relative to the normal itself... which it turns out isn't really necessary given the ultimate usage of the vector.

Thanks again; that's a fast, clean method, and I can just about understand why it works now.