Re: a visualization problem in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg38320] Re: a visualization problem in Mathematica
- From: Selwyn Hollis <hollisse at mail.armstrong.edu>
- Date: Thu, 12 Dec 2002 01:33:14 -0500 (EST)
- References: <at4e6d$f34$1@smc.vnet.net>
- Reply-to: selwynh at earthlink.net
- Sender: owner-wri-mathgroup at wolfram.com
Borut,
If you're willing to use a less "primitive" approach...
First let's assume the radius is 1 and define
p[t_] := (1 - t)*p1 + t*p2
and
curve[p1_,p2_] := ParametricPlot3D[Evaluate[Flatten[{p[t]/Sqrt[p[t].p[t]],
Thickness[0.01]}]], {t, 0, 1}, DisplayFunction->Identity]
This generates random points for testing:
randompoint := Module[{u=2*Pi*Random[], v=Pi*Random[]},
{Cos[u]Sin[v], Sin[u]Sin[v], Cos[v]}]
Now,
<<Graphics`Shapes`;
wiresphere=WireFrame[{GrayLevel[.7],Sphere[]}];
p1 = randompoint
p2 = randompoint
Show[wiresphere, curve[p1,p2]]
Cheers,
Selwyn Hollis
Borut L wrote:
>Hi,
>
>I have the following problem. Given two random points on a sphere, I would
>like to connect them with a curve that goes 'approximately' on the sufrace
>of the spehere. I wrote approximately, because the curve would be made of
>line segments.
>
>Connecting the points with a straigh line is achived by Line[{pt1,pt2}].
>
>I am failing to get good ideas on how to approach the problem, would
>appreciate any hint / trick / tip.
>
>
>Thank you,
>
>Borut Levart
>
>Slovenia
>
>
>
>
>