Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #2802
| From | "Christopher O. Young" <cy56@comcast.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: A question about a sphere |
| Date | 2011-05-30 10:32 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <irvrom$8fn$1@smc.vnet.net> (permalink) |
| References | <hk6cu2$m1a$1@smc.vnet.net> <hkblk0$j2a$1@smc.vnet.net> |
Very good version, but the following will avoid extra covering of the sphere
and still get all the longitudes.
ParametricPlot3D[
{
Cos[phi]*Sin[th],
Cos[phi]*Cos[th],
Sin[phi]
},
{phi, -(Pi/2), Pi/2}, {th, -Pi, Pi + 0.01},
(* Need the 0.01 or Mesh misses one of the longitudes *)
PlotPoints -> {33, 33},
Mesh -> {Range[-(Pi/2), Pi/2, Pi/6], Range[-Pi, Pi, Pi/6]},
Boxed -> False,
Axes -> None
] /. Line[pts_] :> {Magenta, Tube[pts, 0.01]}
We need to avoid the double covering if we want to have non-blotchy
transparency.
ParametricPlot3D[
{
Cos[phi]*Sin[th],
Cos[phi]*Cos[th],
Sin[phi]
},
{phi, -(Pi/2), Pi/2}, {th, -Pi, Pi + 0.01},
PlotPoints -> {33, 33},
Mesh -> {Range[-(Pi/2), Pi/2, Pi/6], Range[-Pi, Pi, Pi/6]},
Boxed -> False,
Axes -> None,
PlotStyle -> Opacity[0.5]
] /. Line[pts_] :> {Magenta, Tube[pts, 0.01]}
On 2/3/10 7:10 AM, in article hkblk0$j2a$1@smc.vnet.net, "Peter Pein"
<petsie@dordos.net> wrote:
> Hi,
>
> IMHO
>
> ParametricPlot3D[
> {Cos[phi] Sin[th],Cos[phi] Cos[th],Sin[phi]},
> {phi,-Pi,Pi},{th,-Pi,Pi},
> PlotPoints->{33,33},Mesh->{9,9},Boxed->False,Axes->None]
>
> is the easiest way to do this task. Choose the values for PlotPoints to
> your needs (to get a sufficiently smooth surface).
>
> Usually the range [-Pi/2,Pi/2] for phi is sufficient to draw a sphere,
> but then - of course - a mesh-line is missing.
>
> Peter
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: A question about a sphere "Christopher O. Young" <cy56@comcast.net> - 2011-05-30 10:32 +0000
csiph-web