title: How to detect if a point is inside a 3d cone
body: <p>I want to write a simple program that constructs a 3d cone (does not need to render) and takes a point and tells if that point is inside a cone (single cone) in c++.</p>
  
  <p>as we do in the circle with center at h,k and point in x,y as <code>(x-h)^2 + (y-k)^2 - r^2 = 0</code> if answer is equal to zero the point lies on the boundary, if less than zero it will be inside the circle and if greater than zero it will be outside the circle so i want this type of simple equation that i can write into a function and return if the point is inside the cone or outside the cone</p>
  
  <p>that pseudo code shall look like 
  the pseudo code for circle:</p>
  
  <pre><code>bool isInsideCircle(Circle circle, Point point)  // circle (radius, center(x,y)), point (x,y)
  {
  
     if ( square(point.x - circle.center.x) + square(point.y - circle.center.y) - square(r) &lt; 0)
        return true
     else 
        return false
  }
  </code></pre>
  
  <p>the pseudo code for cone</p>
  
  <pre><code>bool isInsideCone(Cone cone, Point point) // Point (x,y,z)
  {
     if (here i want this equation which tests that if a point is inside the cone)
        return true
     else
        return false
  }
  </code></pre>
  
  <p>as i know about a cone that it has (height radius and angle theata) in 3d
  now i am not sure how to do this as i am week in mathematics too, 
  this was my first question so now i hope it will be a little bit better for every one to understand</p>