# Find the set of points that lies inside an open $2D$ Cone or find a point lies inside an open $2D$ Cone (which ever is easier)

So the question goes like this, I have an open $$2D$$ Cone, which is defined by its cone axis and a symmetric angle, the equation of the axis cone is $$x\cos\theta + y\sin\theta=r$$ and the symmetric angle about axis cone is $$\omega$$ (i.e. half cone angle is $$\frac{\omega}{2}$$).

The figure bellow gives an apt description of situation. We see that origin of cone is at a distance of $$d$$ from the normal. Now the question is to find the set of points $$\{x,y\}$$ that lie inside this cone.

Approach till now

If the cone is present at the origin as shown in figure below, then the set of points that lie inside the cone is given as

$$R = \left\{(x,y)\; \big|\; \frac{\pi}{2}-\frac{\omega}{2} \leq \tan^{-1}\left(\frac{y}{x}\right) \leq \frac{\pi}{2}+\frac{\omega}{2}\right\}$$ So how can I extend it to my case. I have found answers given by people for similar questions, i.e., here and here, and I think they can be helpful.

In the first of the two posts, if we know the end points of cone(i.e. not an open cone), we can determine whether a point is lying inside or outside the cone.

In the second post, they use vector algebra to find whether a point lies inside a 2D open cone.

Any hints and directions will be appreciated.

Since the points $$(x,y)$$ of the basic circular sector:

$$\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad$$ must satisfy the inequalities:

$$|y|\cos\frac{\omega}{2} \le x\sin\frac{\omega}{2} \quad \quad \text{and} \quad \quad x^2 + y^2 \le R^2$$

recalling the relations of a plane rototranslation:

$$\begin{cases} x' = x_C + x\cos\phi - y\sin\phi \\ y' = y_C + y\cos\phi + x\sin\phi \\ \end{cases} \quad \Rightarrow \quad \begin{cases} x = (x'-x_C)\cos\phi + (y'-y_C)\sin\phi \\ y = (y'-y_C)\cos\phi - (x'-x_C)\sin\phi \\ \end{cases}$$

it follows that the points $$(x,y)$$ of the rototranslated circular sector:

$$\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad$$ must satisfy the inequalities:

$$\left|(y-y_C)\cos\phi-(x-x_C)\sin\phi\right|\cos\frac{\omega}{2} \le \left((x-x_C)\cos\phi+(y-y_C)\sin\phi\right)\sin\frac{\omega}{2}$$

$$\text{and}$$

$$(x-x_C)^2 + (y-y_C)^2 \le R^2$$

with $$R \ge 0$$, $$0 \le \phi \le 2\pi$$, $$0 \le \omega \le 2\pi$$.

• $$R \to \infty$$, so the second inequality is true for all $$(x,y)\in\mathbb{R}^2$$;

• $$(x_C,\,y_C) = \left(r\cos\theta+d\sin\theta,\,r\sin\theta-d\cos\theta\right)$$;

• $$\phi = \theta + \frac{\pi}{2}$$;

so the desired inequality is:

$$\boxed{\left|r-x\cos\theta-y\sin\theta\right|\cos\frac{\omega}{2} \le \left(d-x\sin\theta+y\cos\theta\right)\sin\frac{\omega}{2}}$$

with $$d \ge 0$$, $$r \ge 0$$, $$0 \le \theta \le 2\pi$$, $$0 \le \omega \le 2\pi$$.

• How have you derived the first inequality?, any hints are appreciated Mar 18 at 7:51
• Are you sure about the coordinates of origin of circular sector i.e. $(x_C,\,y_C) = \left(r\cos\theta+d\sin\theta,\,r\sin\theta-d\cos\theta\right)$? What I derived is $(x_C,\,y_C) = \left((r-d)\cos\theta,\,(r-d)\sin\theta\right)$. I found them by solving distance formula of a point on a line and point slope form simultaneously. Thanks Mar 20 at 6:32
• Found my mistake, thanks Mar 20 at 7:47

The direction of the axis of this $$2D$$ cone is given by the unit vector

$$a = (- \sin \theta, \cos \theta )$$

And the vertex of the cone is the point $$V = (x_0, y_0)$$

Given a point $$P = (x , y)$$ , compute the displacement vector from the vertex to the point,

$$u = P - V$$

Then the angle that $$u$$ makes with the axis satisfies

$$\cos \phi = \dfrac{ u \cdot a }{ \| u \|} = \dfrac{ u^T a }{\sqrt{ u^T u} }$$

Since we want to be inside the cone then we require

$$\cos \phi \gt \cos \left(\dfrac{\omega}{2} \right)$$

Squaring, and re-arranging, the condition becomes

$$u^T \left( {a a}^T - \cos^2 \left(\dfrac{\omega}{2}\right) I_2 \right) u \gt 0$$

And, in addition, we must have

$$u^T a \gt 0$$

• Thank you for your effort and time, I understood your answer well. Mar 18 at 7:50