Intersection
Hi all
How to get the intersection region between 2 intersected spheres mathamatically .
Thanks
Come to visit Egypt (the Land of Civilization)
How do you want to define that region? Do you want to create a polygonal mesh that outlines that region, or do you just want a mathematical equation that''s true for any point inside that region?
if it''s the second one, it''s obviously:
VECTOR3D pt;
VECTOR3D a = pt - sphere1.center;
VECTOR3D b = pt - sphere2.center;
if(((a.x * a.x + a.y * a.y + a.z *a.z) < sphere1.radius * sphere1.radius) &&
((b.x * b.x + b.y * b.y + b.z * b.z) < sphere2.radius * sphere2.radius))
{
// inside the region
}
My Site
if it''s the second one, it''s obviously:
VECTOR3D pt;
VECTOR3D a = pt - sphere1.center;
VECTOR3D b = pt - sphere2.center;
if(((a.x * a.x + a.y * a.y + a.z *a.z) < sphere1.radius * sphere1.radius) &&
((b.x * b.x + b.y * b.y + b.z * b.z) < sphere2.radius * sphere2.radius))
{
// inside the region
}
My Site
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement