1

To my best understanding, the minimum number of variables to represent a line in 3D space is four. It means you need at least four values to identify a 3D line. For example from here

$$a x + b y + c z = d \tag{1}$$

defines a line with four variables. However, this is not a unique representation of the line, and by scaling the equation you may still represent the same line:

$$k a x + k b y + k c z = k d \, , \{k \neq 0\} \tag{2}$$

So my question is that what is the minimum number of variables to represent a line in a unique way? In other words, if

$$l_1 \equiv L\{ a_1, a_2, \cdots , a_n \} \tag{3}$$

and

$$l_2 \equiv L\{ b_1, b_2, \cdots , b_n \} \tag{4}$$

then

$$l_1 \equiv l_2 \tag{5}$$

only and if only

$$ \{a_i = b_i, \forall i \in 1,\cdots,n\} \tag{6}$$

Or, if I want to ask my question differently, what is the best way to mathematically represent a line in a 3D space, in a unique way, with the minimum number of degrees of freedom?

P.S.1. I think I have my answer, and it is shamefully simple. Just divide the first equation by $d$. So it seems the minimum number of variables to represent a line (or DOF) in a 3D space in a unique way should be 3:

$$a' x + b' y + c' z = 1 \tag{7}$$

where $\alpha' = \frac{\alpha}{d}$!

P.S.2. The above method doesn't work if $d = 0$, so one needs at least a boolean variable $d' = 0 \, or \, 1$:

$$a' x + b' y + c' z = d' \tag{8}$$

to represent all possible lines in a 3D space.

P.S.3. I made a very silly mistake. Eq.1. represents a plane, not a line!

Foad
  • 431
  • 1
    Ummm.... you demonstrated you can do it with $4$. Do you really think you can do it with $3$? If not, don't you have your answer? – David G. Stork Jan 21 '20 at 22:22
  • @DavidG.Stork I demonstrated that I can do it with 4. but not a unique way. and I can't prove that I can't do it with 3. – Foad Jan 21 '20 at 22:24
  • 1
    That is an interesting way of thinking about unique. You are saying that $2x=4$ and $3x=6$ are different, but I would consider that, once standardized, all coefficients must be coprime (and optimally, the leading coefficient is positive). – Andrew Chin Jan 21 '20 at 22:26
  • @AndrewChin I'm actually writing a code where I want to define a 3D line class. and I want to have an equality method. So I need literal uniqueness. BTW, I think I have the answer in P.S.. maybe you can help m eknow if this is correct or not? – Foad Jan 21 '20 at 22:31
  • 4
    I’m a bit surprised that no one has yet pointed out that equation (1) doesn’t define a line in the first place. It’s the equation of a plane. Now, a line in $\mathbb R^3$ does indeed have four degrees of freedom, but they do not correspond to the coefficients of a single implicit linear equation. It’s actually quite difficult to come up with a usable representation of a line that requires only four values, though—they generally require some special cases. – amd Jan 22 '20 at 01:20
  • @amd you are absolutely right. I made a horrible mistake! but anyway, how can we prove a line has 4 DOF and how we can represent it with 4 variables? – Foad Jan 22 '20 at 08:18

3 Answers3

3

The direction of the line is a point on a sphere, for two degrees of freedom.
Take the plane perpendicular to the direction through the origin. The specific line goes through one point of that plane, for the other two degrees of freedom.

Empy2
  • 50,853
  • I think the 'Hairy Ball Theorem' says you can't pick x'- and y'-axes for each of the planes that vary continuously as the direction changes – Empy2 Aug 14 '20 at 13:06
  • 1
    Indeed. It's possible that Plucker coordinates (which are very closely related to your construction) would address the problem even more uniformly, but since OP seems to want a minimal representation, the 6 coordinates (3 of which constitute a unit vector, the other three really only containing two degrees of freedom) might not appeal. Still, here's a nice reference: http://web.cs.iastate.edu/~cs577/handouts/plucker-coordinates.pdf – John Hughes Aug 14 '20 at 15:13
3

An answer to the question the user really meant to ask, according to the comments

I'm actually writing a code where I want to define a 3D line class. and I want to have an equality method. So I need literal uniqueness.

This is the real problem.

You're mistaken about uniqueness and equality testing.

Representational uniqueness is neither required for equality testing nor universally the best way to do equality testing.

Suppose you specify a line using a pair of distinct points on the line. Now you need to test whether $(P, Q)$ is the same line as $(A, B)$. Here's a solution: test whether $A$ is on the line $PQ$, and $B$ is on the line $PQ$. If so (and only if so), the lines are the same, even though their representations are different. Just to close the loop here, you can test whether $A$ is on $PQ$ by checking whether

(i) $A = P$ or

(ii) $A \ne P$, but $A-P$ and $Q-P$ are proportional (nonzero) vectors.

At this point, there's likely to be some muttering about how this is bad because of numerical issues and IEEE floating point standards and you can't test equality of floats, etc. You really need uniqueness of representation.

Well, consider this: I can write down pairs of distinct points in the plane (or 3-space, but the plane is simpler) $A,B$ and $P, Q$ that mathematically characterize the same line, but which, when mapped into any "unique" representation like @Empy2's excellent one, will produce different results, if the mapping is carried out with any standard floating point representation. So your floating point nightmare is present from the very moment you compute your "unique" representation.

Deep in the heart of things, the problem is that you're hoping to represent a line in 3-space using a computer, and the pigeonhole principle says you're going to lose: there are uncountably many lines, and only countably many representation options. Even if you restrict to line that contain two representable points, you're going to need to use floating-point equality testing to determine whether some point $P$ lies on the line $L$, and that's going to give the wrong answer some of the time. It's probably best (but very difficult) to decide what properties of lines-in-3-space you really like and want to preserve in your representation, and then prove that your representation actually preserves those properties. As I say, that's really hard. Then again, so is debugging programs with numerical errors in the 14th digit. I've been there. "Proving" turns out to actually be easier. :(

John Hughes
  • 93,729
-1

Maybe $5$? $x,y,z$ of the reference point and a unit vector, which needs $\theta$ and $\phi$?

user577215664
  • 40,625