Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #2802 > unrolled thread
| Started by | "Christopher O. Young" <cy56@comcast.net> |
|---|---|
| First post | 2011-05-30 10:32 +0000 |
| Last post | 2011-05-30 10:32 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: A question about a sphere "Christopher O. Young" <cy56@comcast.net> - 2011-05-30 10:32 +0000
| From | "Christopher O. Young" <cy56@comcast.net> |
|---|---|
| Date | 2011-05-30 10:32 +0000 |
| Subject | Re: A question about a sphere |
| Message-ID | <irvrom$8fn$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 top | Article view | comp.soft-sys.math.mathematica
csiph-web