Re: A question about a sphere
- To: mathgroup at smc.vnet.net
- Subject: [mg107097] Re: A question about a sphere
- From: dh <dh at metrohm.com>
- Date: Tue, 2 Feb 2010 06:54:08 -0500 (EST)
- References: <hk6cu2$m1a$1@smc.vnet.net>
Hi,
in mathematica there is no 3 dim circle. Therefore, we have to
approximate the circles using small lines. Here is an example for what
you asked for:
lat[phi_] :=
Line[Table[{Cos[phi] Sin[th], Cos[phi] Cos[th], Sin[phi]}, {th, 0,
2 Pi, Pi/20}]];
long[phi_] :=
Line[Table[{Cos[th] Sin[phi], Cos[th] Cos[phi],
Sin[th]}, {th, -Pi/2, Pi/2, Pi/20}]];
Graphics3D[{Sphere[{0, 0, 0}, 1]
, Table[lat[th], {th, -Pi/2, Pi/2, Pi/6}]
, Table[long[th], {th, -Pi, Pi, Pi/2.5}]
}]
Note, as the circles are on the sphere it is not clear if they are
visible or not. For certain positions the circles are not alsways drawn
fully. To prevent this, you may either draw the circles a little bit
larger than the spehre or use Opacity.
Daniel
Marwa Abd El-Wahaab wrote:
> Dear Sir,
>
> I am a Mathematica 7 user.
>
> I have a question :
>
> I want to draw a sphere, then draw 5 circles on this sphere like
> *latitudes*and draw 5 lines on this sphere like
> *longitudes*.
>
> I need your help.
>
> Thanks in advance
>
> Marwa Ali
>
>