Check if point is inside a circular cone in rational^3 domain.

225 Views Asked by At

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.

1

There are 1 best solutions below

4
On

$\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.