Simplified equation for 3D Cone? Want to recover cone from sea of points

122 Views Asked by At

While I see there are a number of responses out there for the equation for a cone, I'm looking for something just a little bit different.

I am trying to take a sea of points and recover the primitive shape that it originates from. At present, I can use a linear equation solver and some simple algebra to recover a cylinder and a sphere (look here for the cylinder method), but I also want to be able to recover a cone.

At a general level, a cone could be described as a surface that is at a particular angle $\theta$ to an origin (C)-normal (N) vector pair: \begin{equation} \frac{(P-C) \cdot N}{||P-C||} = cos \; \theta \end{equation}

Or, by doing some simplifications (such as assuming N is not unit length), this would turn into:

\begin{equation} (P-C)\cdot N = ||P-C|| \end{equation}

And by expansion: \begin{equation} (P\cdot N - C\cdot N)^2 = (P-C) \cdot (P-C) \end{equation}

Eventually, I could expand this out to its quadric form ($a\;x^2 + b\;xy + c\;xz + d\;x + ...+j=0$ with (a,b,c,...) represented by C and N. But the expansion appears to be quite ridiculous at this point and I'm hoping I'm missing a trick to make it easier to recover some of the parameters.

The question I have is: if I can determine a, b, ..., j, what is the easiest way to recover C and N? Or is there another representative cone equation I should use instead?

Thanks in advance!