# Intersection of a plane with a segment in n dimensions

• I
• jk22

#### jk22

I take 2 points given by the vectors of coordinates ##\vec{p}_i,\vec{p}_j## and a plane spanned by ##\vec{e}_k,k=1,2##.

All the vectors are in dimension n.

I want to find the intersection of the segment described by the extremities given by the ##\vec{p}_k## with the plane, if any.

Is it correct to say the following :

Let $$\vec{d}_k=\vec{p}_k-Proj(\vec{p}_k,\pi_{e_1,e_2}),k=i,j$$.

if ##\vec{d}_i\cdot\vec{d}_j<0## there is an intersection ?

The intersection point is found by selecting 3 equations among the system : ##\alpha(\vec{p}_j-\vec{p}_i)+\vec{p}_i=\beta\vec{e}_1+\gamma\vec{e}_2## for which the determinant is nonzero and solving for the greek coefficients ?

Yes, that looks correct.

I don't know how to be sure, I generalized from 3 dimensional space.

Could it be that for example in 4D the condition of intersection fail, because the segment in some way avoids the plane in the other dimension ?

Also a segment in 4 dimensions can have spherical symmetry, taking the well-known singlet state of quantum mechanics. So the intersection of a 4-vector with a plane could be a circle ?

• andrewkirk
I don't know how to be sure, I generalized from 3 dimensional space.

Could it be that for example in 4D the condition of intersection fail, because the segment in some way avoids the plane in the other dimension ?

Also a segment in 4 dimensions can have spherical symmetry, taking the well-known singlet state of quantum mechanics. So the intersection of a 4-vector with a plane could be a circle ?
The dimension of the intersection set for general position equals the dimension of the ambient space minus the sum of the two objects intersecting.

The dimension of the intersection set for general position equals the dimension of the ambient space minus the sum of the two objects intersecting.

Well the intersection of a segment with a plane can be empty, a point, or a segment in 3 dimensional space.

In the OP case 4-2-1=1. But a circle has intrinsic dimension 1

Last edited:
Well the intersection of a segment with a plane can be empty, a point, or a segment in 3 dimensional space.

In the OP case 4-2-1=1. But a circle has intrinsic dimension 1
Yes, general position refers to the case that is most likely. And I don't understand the 'But', results seem to agree with what was predicted/expected.

In fact I'm trying to code a tomography program through an hypercube of dimension n (=>quasicrystals?).

So I wanted a formula that generalize the one using cross product that works only if d=3. Then I arrived at the OP formula but I don't see how the system of equation, which is linear, can lead to a circle in first view ?

In my expectation a segment that intersects with a plane should give a single point even in n dimensions, else the idea becomes unusable.

In fact I'm trying to code a tomography program through an hypercube of dimension n (=>quasicrystals?).

So I wanted a formula that generalize the one using cross product that works only if d=3. Then I arrived at the OP formula but I don't see how the system of equation, which is linear, can lead to a circle in first view ?

In my expectation a segment that intersects with a plane should give a single point even in n dimensions, else the idea becomes unusable.
But I am not clear on what the dimension of your ambient space is: If the ambient space is the standard space we live in, 3-space, then 3-2-1=0 , the intersection is then a point ( assuming standard position). I don't understand why you assumed your ambient space is 4D , since in your calculation you obtained 4-2-1=1.

So the intersection of a 4-vector with a plane could be a circle ?
I assume by 4-vector you mean line, ray or segment in 4D Euclidean space. In that case the answer is no. Regardless of the dimension of the ambient space, the points of the intersection are exactly the points ##\alpha(\vec{p}_j-\vec{p}_i)+\vec{p}_i##, for ##\alpha,\beta,\gamma## a solution of the equation at the end of your OP. There will either be no intersection, or one point of intersection, or else the entire line segment must lie in the plane. That much is just algebra, not geometry, and does not depend on the dimension of the ambient space.

The dimensionality of the ambient space does however come into the question of whether there is a solution at all - ie whether the segment intersects the plane. It may be that the inner product approach above is not valid for more than three dimensions. I'll have to think about that. However a test that should certainly work is the one suggested in your OP - to just see whether there is 3x3 submatrix with nonzero determinant.

I assume by 4-vector you mean line, ray or segment in 4D Euclidean space. In that case the answer is no. Regardless of the dimension of the ambient space, the points of the intersection are exactly the points ##\alpha(\vec{p}_j-\vec{p}_i)+\vec{p}_i##, for ##\alpha,\beta,\gamma## a solution of the equation at the end of your OP. There will either be no intersection, or one point of intersection, or else the entire line segment must lie in the plane.
How can a 4D Euclidean vector lie in a 2D-Euclidean plane? EDIT : Unless at least two of its coordinates are 0, I guess?

How can a 4D Euclidean vector lie in a 2D-Euclidean plane? EDIT : Unless at least two of its coordinates are 0, I guess?
A plane in n-dimensional Euclidean space is just a 2-dimensional submanifold that satisfies certain linearity constraints. Such a plane can be specified by vectors ##\vec a, \vec b, \vec c\in\mathbb R^n## provided that ##\vec a\cdot \vec b = \vec a\cdot\vec c = 0## and ##\vec a## is not a multiple of ##\vec b## or vice versa (collinear vectors). The plane consists of all points with displacement vectors from the origin in the following set:
$$\left\{\vec a + s\vec b + t \vec c\ :\ s,t\in\mathbb R \right\}$$
Here ##\vec b## and ##\vec c## determine the orientation of the plane and ##\vec a## gives its normal displacement from the origin.

A line in the plane can be specified by two additional parameters ##\alpha,\beta\in\mathbb R## such that ##\alpha\beta\neq 0##. It consists of points with displacement vectors in the following set:
$$\left\{\vec a + t(\alpha \vec b +\beta \vec c)\ :\ t\in\mathbb R\right\}$$
Here the vectors ##\vec b,\vec c## act as a basis for the plane, ##\alpha,\beta## are the components of the direction vector of the line, expressed in that basis, and ##t## is the linear parameter for the line.

I get the impression from the OP that they are considering only planes that pass through the origin, that is with ##\vec a=\vec 0##.

I get the feeling you may be imagining a plane that is perpendicular to one or more of the axes of a Cartesian coordinate system. In such a case, all but two of the components of ##\vec b## and ##\vec c## would be zero in that coordinate system as you point out, and they would be the same components. But a linear manifold does not have to be perpendicular to coordinate axes to be considered a plane. Indeed, the notion of a plane is coordinate-free.

Now that i think about it some more, the linear ( or otherwise general) 2-manifold can have all nonzero coordinates. It just has to be the case that only two -- exactly two, actually --are independent, i.e., it is a function of exactly two parameters, say s and t.
Edit: Not that i think I am saying something greatly insightful here, just to clarify.

Last edited:
I wonder if this would be overkill, but, if we work in 4d, we could use the intersection form.

Got it.

The test in the OP for whether there is an intersection can be expressed alternatively, only in the 3D case, as that there will be an intersection iff there exists negative ##r\in\mathbb R## such that ##\vec d_1= r\vec d_2##.

Intuitively, that says that, to get by ##-\vec d_1##, which means heading to the nearest point on the plane and stopping when we hit the plane at point ##\pi\vec p_1##. Then we travel through the plane in a straight line to the point ##\pi\vec p_2##. Lastly, we displace from there by ##-\vec d_2## to get to ##\vec p_2##. That entire trajectory lies in the plane P2 containing the segment S2 connecting ##\pi\vec p_1## to ##\pi\vec p_2## and the lines through ##\pi \vec p_1## and ##\pi\vec p_2## that are normal to the original plane, call it P1. It follows that the segment S1 that goes direct from ##\vec p_1## to ##\vec p_2## also lies in P2. So the problem is reduced to a 2D problem in plane P2, which is whether segments S1 and S2 intersect. That will be the case if the dot product test in the OP, or the above simplification of it, is passed. We can ignore all dimensions except the two dimensions of the plane and a third dimension that is that of vectors ##\vec d_1,\vec d_2##. So it becomes a 3D problem.

When the ambient space has more than three dimensions, we follow the same procedure. We need only consider the subspace generated by the plane and the vectors ##\vec d_1, \vec d_2##. The only difference from the 3D case is that in 3D, the ##\vec d_k## are guaranteed to be collinear, so the only test is whether they have opposite signs. With four or more dimensions, they may not be collinear. If they are not, the subspace containing the plane and the two perps to the two points off it will be 4D, and there will be no intersection. But if they are collinear, the subspace is 3D and the problem is the same as when the ambient space is 3D.

In short, the inner product test in the OP needs to be replaced by the above test, and then it will apply for any number of dimensions.

• WWGD
Hope I am not too far off, but I wonder if we can use ( or, have we used?) the Geometric Hahn-Banach theorem here, using a line ( extending the line segment joining ##p_i, p_j ## so it becomes a line) and plane as convex sets?

Interesting thought. I don't think we need Hahn-Banach. The above is a consequence of the ability to extend an orthogonal basis for a subspace of a finite-dimensional, real vector space to an orthogonal basis for the whole vector space, which follows fairly readily from the vector space axioms.

The Hahn-Banach separation theorem is heavier machinery, and appears to use a weakened version of the axiom of choice, see here.

The separation theorem asserts the existence of a hyperplane (which in this case would be a linear manifold of dimension n-1, rather than of dimension 2 as in the OP) that separates the two convex sets. For application of the theorem to be valid, the two sets must be disjoint, which presupposes an answer to the question of the OP, ie that there is no intersection. Also, one of the convex sets has to be compact. Since a plane is not compact, it would have to be the segment, not extended to a line (else it would cease to be compact).

• WWGD
Yes, I wondered if we could get a contradiction by assuming we could separate the segment from the plane. Let me play with that idea a bit. Edit: I meant using some variant or corollary since, as you correctly point out, the standard statement talks about hyperplanes and not 2D- planes, which is what we have.

Last edited:
In fact I'm trying to code a tomography program through an hypercube of dimension n (=>quasicrystals?).

So I wanted a formula that generalize the one using cross product that works only if d=3. Then I arrived at the OP formula but I don't see how the system of equation, which is linear, can lead to a circle in first view ?

In my expectation a segment that intersects with a plane should give a single point even in n dimensions, else the idea becomes unusable.
The intersection of linear/affine objects is linear/ affine and a circle is neither of those.