RE: Dashed space curve
- To: mathgroup at smc.vnet.net
- Subject: [mg47196] RE: [mg47158] Dashed space curve
- From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
- Date: Tue, 30 Mar 2004 04:01:22 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
>-----Original Message----- >From: mika_lists at yahoo.com [mailto:mika_lists at yahoo.com] To: mathgroup at smc.vnet.net >Sent: Sunday, March 28, 2004 7:08 AM >To: mathgroup at smc.vnet.net >Subject: [mg47196] [mg47158] Dashed space curve > > >Hello, > >I would like to draw a dashed space curve (using ParametricPlot3D). >How can I achieve that? > >Regards, >Michael > Unless you happen to parametrize your curve by length, Dashing or AbsoluteDashing are useless. See e.g. In[4]:= l = .05; In[5]:= ParametricPlot3D[{E^-(l t) Sin[t], E^-(l t) Cos[t], t, AbsoluteDashing[{5}]}, {t, 0, 50}, BoxRatios -> {1, 1, 1}, PlotRange -> All, PlotPoints -> 500] The graphics directive is accepted, but the dashing goes along with the parameter, not in visible (3D) space. In fact, Help describes Dashing as a two-dimensional graphics directive. Here is a way to a nice dashing in 3D: construct your line segments by yourself In[6]:= l = .05; In[7]:= f[t_] = {E^-(l t) Sin[t], E^-(l t) Cos[t], t/25}; ...the function describing our curve; we integrate for the curve length: In[8]:= s[t_] = Integrate[Sqrt[D[f[t], t].D[f[t], t]] /. t -> tt, {tt, 0, t}] In[9]:= s50 = s[50.] Out[9]= 18.5563 In[10]:= Plot[s[t], {t, 0, 100}] ...the function is well behaved and invertible. We construct the t-points with equal spacing (and dashing): In[12]:= tpts = (t /. FindRoot[s[t] == #, {t, 0}] &) /@ Flatten[Outer[Plus, Range[0., s50, s50/500], {0, s50/500*1/3}]]; In[13]:= Show[Graphics3D[Line /@ Map[f, Partition[tpts, 2], {2}]], BoxRatios -> {1, 1, 1}] -- Hartmut Wolf