Are the cone and sphere intersecting correctly in my code?

In summary, the conversation is about testing for intersections between a cone and a sphere using a specific algorithm. The individual is experiencing inconsistencies with the results and is seeking advice on potential issues with the code or mathematical principles. They have narrowed down the problem to finding the closest point on the cone to the sphere's centre, and are looking for assistance in achieving this.
  • #1
chrom68
12
0
I am looking to test detect if a cone (described by an apex, angle theta and axis) and a sphere (defined by a sphere centre and a radius) intersect.

Please see here for a complete description (because i can't post the code here):

http://www.gamedev.net/community/forums/topic.asp?topic_id=513868

I am having trouble doing a simple test using this algorithm at the bottom of the link, which brings into question either the code or the validity of the math principles used. Intersections and Misses of the cone and sphere detections aren't consistent. Any advice on what is wrong with the math or the code?
 
Mathematics news on Phys.org
  • #2
I've narrowed down the problem to looking for the closest point on the cone, to the sphere's centre (most likely a perpendicular distance away). The sphere's centre could be inside or outside the cone, hence the radius is the key to knowing whether there is an intersection or not. I've performed a test which allows me to do this, so now i need some help on getting the closest point.
 

1. What is a cone-sphere intersection?

A cone-sphere intersection is a geometric concept that describes the area where a cone (a three-dimensional shape with a circular base and a curved surface) and a sphere (a three-dimensional shape with a perfectly round surface) intersect. This intersection forms a closed curve, and the shape of this curve depends on the relative positions and sizes of the cone and sphere.

2. How is the intersection of a cone and a sphere calculated?

The intersection of a cone and a sphere can be calculated using mathematical formulas that take into account the dimensions and positions of both shapes. These formulas involve the use of trigonometric functions, such as sine and cosine, and can be solved using algebraic methods.

3. What are some real-world applications of cone-sphere intersection?

Cone-sphere intersections have various applications in fields such as architecture, engineering, and physics. For example, they can be used in the design of bridges, tunnels, and other structures, as well as in the study of light and sound waves.

4. What are the properties of a cone-sphere intersection?

A cone-sphere intersection has several properties, including its shape, size, and orientation. The shape of the intersection can range from a single point to a closed curve, and its size and orientation can vary depending on the specific dimensions and positions of the cone and sphere.

5. Are there any special cases of cone-sphere intersection?

Yes, there are several special cases of cone-sphere intersection, including when the cone and sphere are tangent to each other, when the cone is completely inside the sphere, and when the sphere is completely inside the cone. In these cases, the intersection takes on unique shapes and properties.

Similar threads

  • Programming and Computer Science
Replies
1
Views
1K
Replies
1
Views
1K
Replies
9
Views
6K
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
Replies
4
Views
3K
  • STEM Academic Advising
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
Back
Top