[FT] [computer] 3D math
From: "Barclay, Tom" <tomb@b...>
Date: Wed, 6 Sep 2000 15:37:46 -0400
Subject: [FT] [computer] 3D math
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>.
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.
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>.
It strikes me these formula might be useful for determining moves in 3D
vector games on a computer. I'm looking at doing something in this line
of
thought sometime. The math is vaguely disturbing though.
T.
------------------------------------------
Thomas R. S. Barclay
Voice: (613) 722-3232 ext 349
e-mail: tomb@bitheads.com
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/GE d? s-:+ a? C+++(+)$ UL*U+++(--)
P>+++ L+ !E W++$>+++ N++ o+ K- w+++(++)
O+@ M-- V-- PS+ PE+ Y+(Y--) PGP- t* 5++
X- R++(R*) tv b+++>++++ DI+++ D++>D+++
G-- e* h* r y?
------END GEEK CODE BLOCK------
------------------------------------------