From: Kevin J. McCann on 3 Feb 2010 06:08 I thought the Babylonians used base 12. Kevin David Park wrote: > 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.
From: David Park on 3 Feb 2010 06:08 Presentations does have a 3-dimensional circle, Circle3D in which one specifies the origin, the normal, the radius and the angle range. Here is my previous example using Circle3D and RotateOp to rotate about the z axis to each position longitude position. (RotateOp is a postfix version of Rotate which is convenient if one is rotating a large piece of graphics specifications.) Needs["Presentations`Master`"] sphere[r_, \[Phi]_, \[Theta]_] := r {Cos[\[Phi]] Cos[\[Theta]], Cos[\[Phi]] Sin[\[Theta]], Sin[\[Phi]]} primeMeridian = Circle3D[{0, 0, 0}, {0, 1, 0}, 1, {-\[Pi]/2, \[Pi]/2}]; Draw3DItems[ {(* Draw the sphere *) Opacity[.5], Orange, Sphere[], (* Draw 5 lines of latitude *) Opacity[1], Black, Table[Circle3D[{0, 0, Sin[lat]}, {0, 0, 1}, Cos[lat]], {lat, {80 \[Degree], 40 \[Degree], 0, -40 \[Degree], -80 \[Degree]}}], (* Draw lines of longitude *) Table[primeMeridian // RotateOp[long, {0, 0, 1}], {long, 0, 288 \[Degree], 72 \[Degree]}]}, NeutralLighting[0, .5, .1, 0 \[Degree], -30 \[Degree]], NiceRotation, Boxed -> False, ImageSize -> 400] David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: dh [mailto:dh(a)metrohm.com] 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 > >
From: Tomas Garza on 3 Feb 2010 06:10 Fine, but you wrote "R" instead of "r" in the second and third plots. Tomas > Date: Tue, 2 Feb 2010 03:27:31 -0500 > From: jlucio(a)ubu.es > Subject: Re: A question about a sphere > To: mathgroup(a)smc.vnet.net > > 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: Peter Pein on 3 Feb 2010 06:10 Am 01.02.2010 12:12, schrieb Marwa Abd El-Wahaab: > 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 > > 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
From: DrMajorBob on 3 Feb 2010 06:11 That doesn't work as written, but it does if you change the first statement to R = 1 or better yet, replace R with r in the other statements. Bobby On Tue, 02 Feb 2010 02:27:31 -0600, JH <jlucio(a)ubu.es> wrote: > 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 > -- DrMajorBob(a)yahoo.com
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Evaluating Problem in Generating Random Text Next: Dynamic plot + real data set |