Prev: Re: Gencon UK 2000 Results Next: Re: [FT] [computer] 3D math

# Re: [FT] [computer] 3D math

From: Jon Davis <davisje@n...>
Date: Wed, 06 Sep 2000 21:33:28 -0400
Subject: Re: [FT] [computer] 3D math
``````
"Barclay, Tom" wrote:
>
> Hiya
>
> I'm looking for a non-horrendous formula for calculating, given the
> following facts,
>
> - in 3 space
> - a sphere we shall call S1 located at coorinates (x1,y1,z1) of radius
r1.
> - a sphere we shall call S2 located at coorinates (x2,y2,z2) of radius
r2.
> - a point we shall call P3 located at coordinates (x3,y3,z3).
>
> A) Do r1 and r2 intersect one another? What formula will determine
this?
>
> <My guess: Take a line between the centre of S1 and S2 and determine
if the
> length of this segment exceeds the sum of the radii r1 and r2>.

If the line segment is less than the sum of the r1 and r2, then the
spheres
intersect.

> B) What percentage of the volume of S2 is contained within S1? What
formula
> will determine this?
>
> This one I won't guess at. I can't think of an elegant generic
solution that
> doesn't work by regions.

This is a harder problem, Tom.	It is possible to compute the circle of
intersection
in 3-space between the two spheres.  Once that has been computed and its
location,
you could compute the volume of the union by summing the portion of each
sphere
cut by the plane of intersection.  Just curious, why do you need this
computation?

> B) Is point P3 within sphere S1?
>
> <My guess here is take the magnitude of the line between the centre of
S1
> and P3 and if it is <= radius r1 then P3 is inside of S1>.

This is correct.

``````

 Prev: Re: Gencon UK 2000 Results Next: Re: [FT] [computer] 3D math