From: Marwa Abd El-Wahaab on 1 Feb 2010 06:12 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
From: David Park on 2 Feb 2010 03:24 Here is an easy solution using the Presentations package. First we parametrize a sphere and then draw the sphere, the lines of latitude, and the lines of longitude using the parametrization. (We could have just used Sphere for the sphere.) I used 6 lines of longitude in honor of the Babylonians. Needs["Presentations`Master`"] sphere[r_, \[Phi]_, \[Theta]_] := r {Cos[\[Phi]] Cos[\[Theta]], Cos[\[Phi]] Sin[\[Theta]], Sin[\[Phi]]} Draw3DItems[ {(* Draw the sphere *) Opacity[.5], Orange, ParametricDraw3D[ sphere[1, \[Phi], \[Theta]], {\[Phi], -\[Pi]/2, \[Pi]/ 2}, {\[Theta], 0, 2 \[Pi]}, Mesh -> None], (* Draw 5 lines of latitude *) Opacity[1], Black, Table[ParametricDraw3D[ sphere[1, lat, \[Theta]], {\[Theta], 0, 2 \[Pi]}], {lat, {80 \[Degree], 40 \[Degree], 0, -40 \[Degree], -80 \[Degree]}}], (* Draw lines of longitude *) Table[ParametricDraw3D[ sphere[1, \[Phi], long], {\[Phi], -\[Pi]/2, \[Pi]/2}], {long, 0, 300 \[Degree], 60 \[Degree]}]}, NeutralLighting[0, .5, .1, 0 \[Degree], -30 \[Degree]], NiceRotation, Boxed -> False, ImageSize -> 400] NeutralLighting provides white lights with a little ambient light and lowered to give a better rendering. NiceRotation prevents jumping of the image if you rotate with the mouse. David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: Marwa Abd El-Wahaab [mailto:m.a.elwahaab(a)gmail.com] 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
From: JH on 2 Feb 2010 03:27 On 1 feb, 12:12, Marwa Abd El-Wahaab <m.a.elwah...(a)gmail.com> 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 Hello, You can do the following: Suppose the radio is 1 an the center of the sphere is at the origin: r = 1; gg = Graphics3D[Sphere[{0, 0, 0}, 1]]; pp = ParametricPlot3D[ Table[{R Cos[\[CurlyPhi]] Cos[\[Theta]], R Cos[\[CurlyPhi]] Sin[\[Theta]], R Sin[\[CurlyPhi]]}, {\[CurlyPhi], -\[Pi]/3, \[Pi]/3, \[Pi]/ 6}], {\[Theta], 0, 2 \[Pi]}]; (* the parallels or circles of latitude *) mm = ParametricPlot3D[ Table[{-R Cos[\[Theta]] Sin[\[Delta]], R Cos[\[Theta]] Cos[\[Delta]], R Sin[\[Theta]]}, {\[Delta], 0, 2 \[Pi], 2 \[Pi]/5}], {\[Theta], 0, 2 \[Pi]}]; (* the meridians *) Show[gg, pp, mm] (* See all together *) JH
From: Patrick Scheibe on 2 Feb 2010 03:27 Hi, for example: take spherical coordinates and use ParametricPlot3D to plot your desired lines and circles: Show[{Graphics3D[{Blue, Sphere[{0, 0, 0}, 0.97]}], ParametricPlot3D[ Table[{r*Sin[theta]*Cos[phi], r*Sin[theta]*Sin[phi], r Cos[theta]} /. r :> 1, {phi, 0, 2 Pi, 2 Pi/5}] , {theta, 0, Pi}], ParametricPlot3D[ Table[{r*Sin[theta]*Cos[phi], r*Sin[theta]*Sin[phi], r Cos[theta]} /. r :> 1, {theta, 0, Pi, Pi/5}], {phi, 0, 2 Pi}] }, PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}, {-1.5, 1.5}}] /. Line[pts_] :> {Magenta, Tube[pts, 0.01]} Cheers Patrick On Mon, 2010-02-01 at 06:12 -0500, 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 > >
From: dh on 2 Feb 2010 06:47 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 > >
|
Next
|
Last
Pages: 1 2 3 Prev: Evaluating Problem in Generating Random Text Next: Dynamic plot + real data set |