Re: A question about a sphere
- To: mathgroup at smc.vnet.net
- Subject: [mg119303] Re: A question about a sphere
- From: "Christopher O. Young" <cy56 at comcast.net>
- Date: Mon, 30 May 2011 06:32:58 -0400 (EDT)
- 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 at smc.vnet.net, "Peter Pein" <petsie at 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 >