Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: tubes program not working in version 9
Replies: 3   Last Post: Dec 9, 2012 11:32 PM

 Messages: [ Previous | Next ]
 Nasser Abbasi Posts: 6,677 Registered: 2/7/05
Re: tubes program not working in version 9
Posted: Dec 8, 2012 1:28 AM

On 12/7/2012 12:37 AM, Roger Bagula wrote:
> The problem seems to be sometimes it works but mostly it doesn't.
> The tubes program was written for an earlier version
> ( works in version 5 I think) by Mark McClure
> and has worked fine for literally years.
> I haven't got a clue what has gone wrong.
> ( technically these are called channel surfaces or the like).
>
> TubePlotFrenet[curve_List, {var_, min_, max_}, radius_, opts___] :=
> Module[{tangent, unitTangent, normal, unitNormal, biNormal},
> tangent = D[curve, t];
> unitTangent = tangent/Sqrt[tangent.tangent];
> normal = D[unitTangent, t];
> unitNormal = normal/Sqrt[normal.normal];
> biNormal = Cross[unitTangent, unitNormal];
> ParametricPlot3D[
> Evaluate, {var, min, max}, {s, 0, 2 \[Pi]}, opts]]
>
> r = Cos[q0*t] + 2;
> x = r* Cos[p0*t];
> y = r *Sin[p0*t];
> z = Sin[q0*t];
> w0 = 8*{x, y, z}
> h = TubePlotFrenet[w0, {t, 0, 2 \[Pi]}, 1, Axes -> None,
> Boxed -> False, PlotPoints -> {64, 16},
> ColorFunction -> "CandyColors", MeshFunctions -> {#3 &}]
>
> My other tubes program which came from an answer in this group
> still works.
>

Noticed few problems:

tangent = D[curve, t];

when it should be

tangent = D[curve, var];

after all, var is the independent variable symbol being passed
and is the one build in.

Also, there are no numerical values for the q0 and p0.
When I wrote

p0=1; q0=1; and fixed the above issue with var vs. t,
then it worked.

--Nasser

Date Subject Author
12/7/12 Roger Bagula
12/8/12 Nasser Abbasi
12/9/12 Roger Bagula
12/9/12 Roger Bagula