Developers Web home

How to calculate the length of a vector at the point of intersection with a plane

Calculate the length of a vector, from the origin to the intersection with a plane.

We require:

  • a point P on the plane
  • the normal n of the plane
  • the intersecting vector v from the origin

We will now calculate d, which is the length of vector v needed for it to intersect the plane.

d = ( nx × Px ) + ( ny × Py ) + ( nz × Pz )
( nx × vx ) + ( ny × vy ) + ( nz × vz )

If the vector v was a unit vector (of length 1) then the length d is in units.

If the vector v was not a unit vector, then:

  • if 0<d<1 then the vector intersects the plane within its length
  • if d>1 then the vector intersects the plane after its length
  • if d<0 then the vector intersects the plane before the origin
  • if d=1 then the vector intersects the plane at the end of the vector
No conversation on this topic You must be logged in to add to the conversation