3
$\begingroup$

In 3d Euclidean space, limited to rational Cartesian coordinates, we have a circular cone. Cone's tip is at the origin point $p_0$. We know coordinates of $3$ points on cone's surface: $p_1,p_2,p_3$. We can assume that $\{p_0, p_1, p_2, p_3\}$ forms a tetrahedron with non zero volume.

How to test if given point $p_4$ is inside the cone?

I know we could project points $p_1,p_2,p_3,p_4$ onto a sphere centered at $p_0$, resulting in $q_1,q_2,q_3,q_4$ accordingly, then calculate circumcenter from $q_1,q_2,q_3$ projections in order to get cone's axis vector $c$. Then check if dot product of cone's axis $c$ with any of $q_1, q_2, q_3$ projections is smaller than dot product of axis with $q_4$ projection. enter image description here Unfortunately, calculating projections makes use of square root which produces real numbers while we are limited to rational numbers only.

$\endgroup$
2
  • $\begingroup$ I can think of a couple other ways, but they all also use square roots - Euclidean space is intrinsically tied to the 2-norm after all. Can you round the square root to the nearest rational number you can represent in your system? $\endgroup$ Commented Sep 3, 2022 at 12:14
  • $\begingroup$ I've pondered about 5 or 6 methods, and I can go quite a way in some with just rational computations, but eventually they all require either approximating a square root or approximating the result of a trig function. Besides, you're already accepting roundoff in saying the rational points are "on" the surface of a spherical cone. $\endgroup$ Commented Sep 3, 2022 at 22:12

1 Answer 1

3
+50
$\begingroup$

$\space\space\space$Suppose we have the point $p_1=(x_1,y_1,z_1)$ which we know to be on the surface of the cone. Then we know that;

$$\tan^2(\theta)={(x_1^2+y_1^2)\over z_1^2}$$ Where $\theta$ is the angle between the $z$-axis and the surface of the cone.

Using only this, we can determine if a point $p_c$ lies within our cone. Suppose that $p_c=(x_c,y_c,z_c)$ and consider the level set of points on the surface of the cone at $z=z_c$. For all such points, we must have... $${(x_1^2+y_1^2)\over z_1^2}={r_c^2\over z_c^2} \implies r_c^2={{(x_1^2+y_1^2)\cdot z_c^2\over z_1^2}}$$

So any point $p_c$ such that;

$$x_c^2+y_c^2<r_c^2$$

will lie within the surface of our cone.

$\endgroup$
4
  • $\begingroup$ That works only when the cone's axis is fixed at coordinate system Z axis. Question is about cone with arbitrary axis direction (that's the reason for having 3 on surface points). Anyway thanks @Volk for posting your answer. $\endgroup$ Commented Aug 28, 2022 at 9:59
  • $\begingroup$ @Anonymous Can't you always rotate your coordinate axis to define the center of your cone as the z-axis? Or does the restriction to rationals somehow make that a problem? $\endgroup$ Commented Aug 28, 2022 at 14:33
  • $\begingroup$ Rotation is fine, but in order to find rotation matrix, we'd need to find cone's axis. So if you know how to calculate axis using rational numbers that would be solution! $\endgroup$ Commented Aug 28, 2022 at 15:01
  • $\begingroup$ Where is the z-axis? $\endgroup$ Commented Apr 15, 2023 at 4:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.