Graphics, text and turning lines into tubes?
- To: mathgroup at smc.vnet.net
- Subject: [mg78887] Graphics, text and turning lines into tubes?
- From: John Wallbank <J.R.Wallbank at Warwick.ac.uk>
- Date: Thu, 12 Jul 2007 05:13:37 -0400 (EDT)
Hi,
I have a few questions and I was wondering if any one could help me with any of them.
Firstly is there a command for zooming in on part of 3D parametric plot, or changing the direction that the camera is pointing? I know there is ViewPoint but are there any others?
Secondly I have been creatring animations Animate and ParametricPlot3D then adding an explanation using Epilog->Text["writing",{coords}] on a colored background. Is there a way of controlling the size of this background so that the text fits in and also is there a way of telling Text to start a new line?
Finally I have some parameterisations of 3D lines. Now what i realy want is tubes instead of lines so what I did way basically to find the tangent to those lines then rotate (using a matrix) and translate circles on to that line perpendicular to the tangent. Then I used parametricplot3D to draw it. This works but it takes ages which isn't good when i eventually want to create an animation with is. Has any one got any suggestions?
Thanks
John
PS: This is what i am doing to turn lines into tubes:
<< NumericalMath`NLimit`
<< Graphics`ParametricPlot3D`
rotx[θ_] := {{1, 0, 0}, {0, Cos[θ], Sin[θ]}, {0, -Sin[θ], Cos[θ]}}
bump[s_] := \[ExponentialE]^-(s^4)
Arm[s_] := rotx[2*Pi*bump[s]].{0,s,0}
ParametricPlot3D[Arm[s], {s, -3, 3, .1}, PlotRange -> All, AxesLabel -> {"
x", "y", "z"}]
direct[param_, v_] := ND[param[x], x, v, Terms -> 5]
UnitTentTang[param_, v_] := direct[param, v]/Norm[direct[param, v]]
ais[param_, α_] := N[UnitTentTang[param, α].{1, 0, 0}]
bis[param_, β_] := N[UnitTentTang[param, β].{0, 1, 0}]
cis[param_, δ_] := N[UnitTentTang[param, δ].{0, 0, 1}]
\!\(CircRoty[param_, t_] := {{\@\(1 - ais[param, t]^2\),
0, ais[param, t]}, {0, 1, 0}, {\(-ais[param, t]\), 0, \@\(1 -
ais[param, t]^2\)}}\[IndentingNewLine]
CircRotx[param_, t_] := {{1, 0, 0}, {0, cis[param, t]/â??\((1 -
ais[param, t]^2)\), bis[param, t]/â??\((1 - ais[param, t]^2)\)}, {0, \
\(-bis[param, t]\)/â??\((1 - ais[param, t]^2)\), cis[param, t]/â??\((1 - ais[param,
t]^2)\)}}\[IndentingNewLine]
RotateCircle[param_, t_] := CircRotx[param, t] . CircRoty[param, t]\)
Fatness = 0.08;
OpenCurv = 1.5;
Rad[Ï?_] := Fatness;
N[RotateCircle[0].{0, 0, 1}]
Worm = Timing[ParametricPlot3D[
RotateCircle[Arm, t].{Rad[t]*Cos[s], Rad[t]*
Sin[s], 0} + Arm[t], {t, 0, 2, .05}, {s, 0,
2*Pi, Pi/4}, AxesLabel -> {"x", "y", "z"}, PlotRange -> All]]