COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Intersection of 3 spheres in PSTricks

• Follow

How do I draw the shape of the intersection of three equal spheres?

I would like some sort of 3-D drawing that displays the spheres and the
lozenge-like shape of the their intersection.  Specifically, the spheres have
radius 1 and are centered at the vertices of an equilateral triangle in the
x-y plane with side length 3/sqrt(3).

Thanks.
--

Professor Edward M. Reingold                Email: reingold@iit.edu
Department of Computer Science              Voice: (312) 567-3309
Illinois Institute of Technology            Fax:   (312) 567-5067
Stuart Building, 228F
10 West 31st Street
Chicago, IL  60616-3729  U.S.A.

 0
Reply reingold (129) 6/29/2010 10:33:50 PM

On 30 juin, 00:33, reing...@emr.cs.iit.edu (Edward M. Reingold) wrote:
> How do I draw the shape of the intersection of three equal spheres?
>
> I would like some sort of 3-D drawing that displays the spheres and the
> lozenge-like shape of the their intersection. =A0Specifically, the sphere=
s have
> radius 1 and are centered at the vertices of an equilateral triangle in t=
he
> x-y plane with side length 3/sqrt(3).
>
> Thanks.
> --
>
> Professor Edward M. Reingold =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Email: reing.=
...@iit.edu
> Department of Computer Science =A0 =A0 =A0 =A0 =A0 =A0 =A0Voice: (312) 56=
7-3309
> Illinois Institute of Technology =A0 =A0 =A0 =A0 =A0 =A0Fax: =A0 (312) 56=
7-5067
> Stuart Building, 228F
> 10 West 31st Street
> Chicago, IL =A060616-3729 =A0U.S.A.

Hello,

Here is a possible solution with pst-solides3D: computing time is very
large and the image obtained at intersections can be improved.
If the quality vector drawing is not important rather use POV-Ray.

http://manuel.luque.perso.neuf.fr/3-spheres/3spheres.pdf
http://manuel.luque.perso.neuf.fr/3-spheres/3spheres.tex

http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres.png
http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres.pov

The codes are two examples:

\documentclass{article}
\usepackage{pst-solides3d}
\usepackage[a4paper]{geometry}
\begin{document}
\begin{center}
\begin{pspicture}(-3.5,-4)(3.2,5)
\psset{lightsrc=3Dviewpoint,viewpoint=3D100 50 20 rtp2xyz,Decran=3D100}
\psset{linecolor=3D{[cmyk]
{0,0.72,1,0.45}},linewidth=3D0.5\pslinewidth,unit=3D1}
\psframe[fillstyle=3Dsolid,fillcolor=3Dgreen!20](-4,-4)(3.2,5)
\pstVerb{/hetre {0.764 0.6 0.204 setrgbcolor} def
}%
\codejps{
/SPHERE {
3 sqrt  [36 36] newsphere
dup (hetre) outputcolors} def
/SPHERE1 {
SPHERE
{0 0.5 0 translatepoint3d} solidtransform
} def
/SPHERE2 {
SPHERE
{0 -0.5 0 translatepoint3d} solidtransform
} def
/SPHERE3 {
SPHERE
{0 0 3 sqrt 2 div translatepoint3d} solidtransform
} def
/SPHERES12 { SPHERE1 SPHERE2 solidfuz} def
/SPHERES123 { SPHERES12 SPHERE3 solidfuz} def
/TORE {0.075 2.75 sqrt [18 72] newtore
dup (Red) outputcolors} def
/TORE1 {TORE {90 0 0 rotateOpoint3d} solidtransform } def
/TORE2 {TORE {30 0 0 rotateOpoint3d} solidtransform
{0 0.25 3 sqrt 4 div translatepoint3d} solidtransform
} def
/TORE3 {TORE {-30 0 0 rotateOpoint3d} solidtransform
{0 -0.25 3 sqrt 4 div translatepoint3d} solidtransform
} def
/TORES12 {TORE1 TORE2 solidfuz} def
/TORES123 {TORES12 TORE3 solidfuz} def
/3SPHERES {SPHERES123 TORES123 solidfuz} def
3SPHERES  drawsolid**}
\axesIIID(2.23,2.23,2.6)(3,3,3)
\end{pspicture}
\end{center}
\end{document}

//------------------POV-RAY ----------------------------------
#include "colors.inc"

// voir le site de :
// http://www.f-lohmueller.de
// sky ----------------------------------------------------------
object{sphere {<0,0,0>,1 hollow }
[0.50 color White*1]
quick_color White*0.5
}
finish {ambient 1 diffuse 0}}
scale 10000} // end of sphere

#declare Camera_Position =3D < 10, 0,5> ;
#declare Camera_Look_At  =3D < 0, 0,0> ;
#declare Camera_Angle    =3D  40 ;

//-------------------------------------------------------------------------=
-----
camera{ orthographic
location Camera_Position
right    x*image_width/image_height
angle    Camera_Angle
look_at  Camera_Look_At
}

light_source{<10,0,5> color White}

union{
sphere {<0,sqrt(3)/2,0>,sqrt(3) pigment{color White}}
sphere {<0,0,0.5>,sqrt(3) pigment{color White}}
sphere {<0,0,-0.5>,sqrt(3)pigment{color White}}
torus{
sqrt(2.75), 0.05   //rayons ext=E9rieur rayon int=E9rieur
pigment {color < 1 , 0 , 0  > }
translate <0,0,0>
rotate <90,0,0>
}
torus{
sqrt(2.75), 0.05   //rayons ext=E9rieur rayon int=E9rieur
pigment {color < 1 , 0 , 0 > }
rotate <-30,0,0>
translate <0,sqrt(3)/4,0.25>
}
torus{
sqrt(2.75), 0.05   //rayons ext=E9rieur rayon int=E9rieur
pigment {color < 1 , 0 , 0  > }
rotate <30,0,0>
translate <0,sqrt(3)/4,-0.25>
}
}

//----------------------------------------------------------

Best Regards

Manuel

 0

>>>>> "M" == Manuel-Luque  <manuel.luque27@gmail.com> writes:

Thanks!  That is close to what I want, but I need the region of intersection
to be dominant and the rest to be faint; how do I do that?  (I confess to not
--

Professor Edward M. Reingold                Email: reingold@iit.edu
Department of Computer Science              Voice: (312) 567-3309
Illinois Institute of Technology            Fax:   (312) 567-5067
Stuart Building, 228F
10 West 31st Street
Chicago, IL  60616-3729  U.S.A.

 0
Reply reingold (129) 7/4/2010 6:35:26 PM

In article <857hlbf635.fsf@emr.cs.iit.edu>,
Edward M. Reingold <reingold@emr.cs.iit.edu> wrote:
>>>>>> "M" == Manuel-Luque  <manuel.luque27@gmail.com> writes:
>
>Thanks!  That is close to what I want, but I need the region of intersection
>to be dominant and the rest to be faint; how do I do that?  (I confess to not

Don't the 3-spheres intersect at a point, the median of the triangle?
The point (sqrt(3)/2, 1, 0) is the median of the triangle with vertices
at (0,0,0) (0,sqrt(3),0) and (sqrt(3)/2,3/2,0) which is equilaterial
with side sqrt(3) = 3/sqrt(3) and is a unit distance from each vertex.

--
Steven Bellenot                 http://www.math.fsu.edu/~bellenot
Professor and Associate Chair               phone: (850) 644-7405
Department of Mathematics                        office: 223 Love
Florida State University          email: bellenot at math.fsu.edu

 0
Reply fakeuser (16) 7/5/2010 4:58:41 PM

On Jul 5, 6:58=A0pm, fakeu...@invalid.domain wrote:
> In article <857hlbf635....@emr.cs.iit.edu>,
> Edward M. Reingold <reing...@emr.cs.iit.edu> wrote:
>
> >>>>>> "M" =3D=3D Manuel-Luque =A0<manuel.luqu...@gmail.com> writes:
>
> >Thanks! =A0That is close to what I want, but I need the region of inters=
ection
> >to be dominant and the rest to be faint; how do I do that? =A0(I confess=
to not
>
> Don't the 3-spheres intersect at a point, the median of the triangle?
> The point (sqrt(3)/2, 1, 0) is the median of the triangle with vertices
> at (0,0,0) (0,sqrt(3),0) and (sqrt(3)/2,3/2,0) which is equilaterial
> with side sqrt(3) =3D 3/sqrt(3) and is a unit distance from each vertex.

as little as I understand the problem myself, but didn't the OP ask
for a *region* (which better be defined by the OP) and not the *point*
of intersection?

KR
Rainer

 0
Reply rais (7) 7/5/2010 8:53:09 PM

>>>>> "f" == fakeuser  <fakeuser@invalid.domain> writes:

f> Don't the 3-spheres intersect at a point, the median of the triangle?
f> The point (sqrt(3)/2, 1, 0) is the median of the triangle with vertices
f> at (0,0,0) (0,sqrt(3),0) and (sqrt(3)/2,3/2,0) which is equilaterial
f> with side sqrt(3) = 3/sqrt(3) and is a unit distance from each vertex.

The region of intersection for the problem as intended (and posted, I hope) is
sort of football-shaped, or maybe a bit like a pistachio or green coconut:

I would like some sort of 3-D drawing that displays the spheres and the
lozenge-like shape of the their intersection.  Specifically, the spheres
have radius 1 and are centered at the vertices of an equilateral triangle in
the x-y plane with side length 3/sqrt(3).

--

Professor Edward M. Reingold                Email: reingold@iit.edu
Department of Computer Science              Voice: (312) 567-3309
Illinois Institute of Technology            Fax:   (312) 567-5067
Stuart Building, 228F
10 West 31st Street
Chicago, IL  60616-3729  U.S.A.

 0

In article <8539vxfxoo.fsf@emr.cs.iit.edu>,
Edward M. Reingold <reingold@emr.cs.iit.edu> wrote:
>>>>>> "f" == fakeuser  <fakeuser@invalid.domain> writes:
>
>    f> Don't the 3-spheres intersect at a point, the median of the triangle?
>    f> The point (sqrt(3)/2, 1, 0) is the median of the triangle with vertices
>    f> at (0,0,0) (0,sqrt(3),0) and (sqrt(3)/2,3/2,0) which is equilaterial
>    f> with side sqrt(3) = 3/sqrt(3) and is a unit distance from each vertex.
>
>The region of intersection for the problem as intended (and posted, I hope) is
>sort of football-shaped, or maybe a bit like a pistachio or green coconut:
>
>  I would like some sort of 3-D drawing that displays the spheres and the
>  lozenge-like shape of the their intersection.  Specifically, the spheres
>  have radius 1 and are centered at the vertices of an equilateral triangle in
>  the x-y plane with side length 3/sqrt(3).
>
>

Look at
http://www.math.fsu.edu/~bellenot/3spheres/3spheres2.pdf
which is the xy-plane of your 3 unit spheres centered at your vertices.

The intersection of all three regions is a point.
The intersection of any two might be a football, but it is actually
a lens. Perhaps you want all three of these?

Perhaps you want bigger radii? (and/or the centers closer together?)
The figure
http://manuel.luque.perso.neuf.fr/3-spheres/3spheres.pdf

http://www.math.fsu.edu/~bellenot/3spheres/3spheres2.sce is the
scilab code that generated the figure. Scilab is free from
www.scilab.org. (the command "exec 3spheres2.sce" will generate
the pdf file. The picture in scilab is better with 3spheres.sce
but the pdf file is not as nice.)

--
Steven Bellenot                 http://www.math.fsu.edu/~bellenot
Professor and Associate Chair               phone: (850) 644-7405
Department of Mathematics                        office: 223 Love
Florida State University          email: bellenot at math.fsu.edu

 0
Reply fakeuser (16) 7/5/2010 10:00:54 PM

On Jul 5, 6:00=A0pm, fakeu...@invalid.domain wrote:
> In article <8539vxfxoo....@emr.cs.iit.edu>,
> Edward M. Reingold <reing...@emr.cs.iit.edu> wrote:
>
> > =A0I would like some sort of 3-D drawing that displays the spheres and =
the
> > =A0lozenge-like shape of the their intersection. =A0Specifically, the s=
pheres
> > =A0have radius 1 and are centered at the vertices of an equilateral tri=
angle in
> > =A0the x-y plane with side length 3/sqrt(3).
>
> The intersection of all three regions is a point.
>
Since 3/sqrt(3) simplifies, I presumed the OP meant to type 2/
sqrt(3). ;)

Getting a bit off-topic for c.t.t, but since the intersection S is
convex, one workable strategy for drawing the intersection is to
calculate the distance from the origin of R^3 to the boundary of S as
a function of a unit direction vector (easy algebra), and then to plot
the resulting parametric surface.
--
Andy
http://mathcs.holycross.edu/~ahwang

 0

>>>>> "ADH" == Andrew D Hwang <buivmmdagr02@sneakemail.com> writes:

ADH> Since 3/sqrt(3) simplifies, I presumed the OP meant to type 2/

I was very careless: I meant an equilateral triangle with side length
6/\sqrt(13) \approx 5/3 and spheres of radius 1.  I don't know what I was
looking at when I typed the original message.  The intersection of these
spheres is sort of football-shaped.

--

Professor Edward M. Reingold                Email: reingold@iit.edu
Department of Computer Science              Voice: (312) 567-3309
Illinois Institute of Technology            Fax:   (312) 567-5067
Stuart Building, 228F
10 West 31st Street
Chicago, IL  60616-3729  U.S.A.

 0

On 6 juil, 05:25, reing...@emr.cs.iit.edu (Edward M. Reingold) wrote:
> >>>>> "ADH" =3D=3D Andrew D Hwang <buivmmdag...@sneakemail.com> writes:
>
> =A0 =A0 ADH> Since 3/sqrt(3) simplifies, I presumed the OP meant to type =
2/
> =A0 =A0 ADH> sqrt(3). ;)
>
> I was very careless: I meant an equilateral triangle with side length
> 6/\sqrt(13) \approx 5/3 and spheres of radius 1. =A0I don't know what I w=
as
> looking at when I typed the original message. =A0The intersection of thes=
e
> spheres is sort of football-shaped.
>
> --
>
> Professor Edward M. Reingold =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Email: reing.=
...@iit.edu
> Department of Computer Science =A0 =A0 =A0 =A0 =A0 =A0 =A0Voice: (312) 56=
7-3309
> Illinois Institute of Technology =A0 =A0 =A0 =A0 =A0 =A0Fax: =A0 (312) 56=
7-5067
> Stuart Building, 228F
> 10 West 31st Street
> Chicago, IL =A060616-3729 =A0U.S.A.

Sorry for my first try: I had not understood.
Here is the second try with POV-RAY: is it this drawing which you
wish?

http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_2.png
http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_2.pov

You want to make it with PStricks?

Best regards,

Manuel

 0

First of all, thanks for the help!

>>>>> "M" == Manuel-Luque  <manuel.luque27@gmail.com> writes:

>> I was very careless: I meant an equilateral triangle with side length
>> 6/\sqrt(13) \approx 5/3 and spheres of radius 1. �I don't know what I
>> was looking at when I typed the original message. �The intersection of
>> these spheres is sort of football-shaped.

M> Sorry for my first try: I had not understood.  Here is the second try
M> with POV-RAY: is it this drawing which you wish?

M> http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_2.png
M> http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_2.pov

I need to show (faintly) the three spheres with the intersection of all three
spheres highlighted by being darker.  Your diagram shows the intersections of
pairs, I think.

M> You want to make it with PStricks?

Ideally I'd like to do it with PSTricks, but a drawing that I can make into an
..eps file would work also.
--

Professor Edward M. Reingold                Email: reingold@iit.edu
Department of Computer Science              Voice: (312) 567-3309
Illinois Institute of Technology            Fax:   (312) 567-5067
Stuart Building, 228F
10 West 31st Street
Chicago, IL  60616-3729  U.S.A.

 0

On 6 juil, 16:14, reing...@emr.cs.iit.edu (Edward M. Reingold) wrote:
> First of all, thanks for the help!
>
> >>>>> "M" =3D=3D Manuel-Luque =A0<manuel.luqu...@gmail.com> writes:
>
> =A0 =A0 >> I was very careless: I meant an equilateral triangle with side=
length
> =A0 =A0 >> 6/\sqrt(13) \approx 5/3 and spheres of radius 1. =A0I don't kn=
ow what I
> =A0 =A0 >> was looking at when I typed the original message. =A0The inter=
section of
> =A0 =A0 >> these spheres is sort of football-shaped.
>
> =A0 =A0 M> Sorry for my first try: I had not understood. =A0Here is the s=
econd try
> =A0 =A0 M> with POV-RAY: is it this drawing which you wish?
>
> =A0 =A0 M>http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_2.png
> =A0 =A0 M>http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_2.pov
>
> I need to show (faintly) the three spheres with the intersection of all t=
hree
> spheres highlighted by being darker. =A0Your diagram shows the intersecti=
ons of
> pairs, I think.
>
> =A0 =A0 M> You want to make it with PStricks?
>
> Ideally I'd like to do it with PSTricks, but a drawing that I can make in=
to an
> .eps file would work also.
> --
>
> Professor Edward M. Reingold =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Email: reing.=
...@iit.edu
> Department of Computer Science =A0 =A0 =A0 =A0 =A0 =A0 =A0Voice: (312) 56=
7-3309
> Illinois Institute of Technology =A0 =A0 =A0 =A0 =A0 =A0Fax: =A0 (312) 56=
7-5067
> Stuart Building, 228F
> 10 West 31st Street
> Chicago, IL =A060616-3729 =A0U.S.A.

Okay.
Use of POV-Ray:

1) An overview. The transparency is not evident.

http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_3_0.png
http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_3_0.pov
2) A moved closer view.

http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_3_1.png
http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_3_1.pov
3) A view of the intersection.

http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_3_2.png
http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_3_2.pov

Modify the parameters of light, camera, texture to make the drawing
A conversion in the format eps is easy with GIMP or Imagemagick.

http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_3_0.eps
http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_3_1.eps
http://manuel.luque.perso.neuf.fr/3-spheres/3_spheres_3_2.eps

Best Regards,

Manuel

 0

11 Replies
571 Views

Similiar Articles:

7/24/2012 10:28:59 AM