Group Abstract Group Abstract

Message Boards Message Boards

1
|
3.2K Views
|
7 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Plot mapped on a torus

Posted 3 years ago
POSTED BY: Bernd Wichmann
7 Replies
With[{r = 1}, 
  torus[{u_, 
     v_}] := {(3 + Cos[2 \[Pi] u]) Cos[
      2 \[Pi] v], (3 + Cos[2 \[Pi] u]) Sin[2 \[Pi] v], 
    r Sin[2 \[Pi] u]}];
Show[ParametricPlot3D[torus[{u, v}], {u, 0, 1}, {v, 0, 1}, 
  Mesh -> None],
 ParametricPlot3D[torus[{Sin[2 \[Pi] t], 0}], {t, 0, 1/2}],
 Graphics3D[{Arrowheads[0.05], 
   Arrow[Tube@{torus[{Sin[2 \[Pi] *.5], 0}], 
      torus[{Sin[2 \[Pi] *.51], 0}]}]}]]
POSTED BY: Gianluca Gorni
Posted 3 years ago

Molte grazie

POSTED BY: Bernd Wichmann

Your torus takes two coordinates and outputs three coordinates. To map a curve onto the torus you describe it in (u,v) and then torus maps int onto the surface in 3D.

POSTED BY: Gianluca Gorni
Posted 3 years ago
POSTED BY: Bernd Wichmann

Sin[t] takes values between -1 and 1. If you want a whole circle you can multiply by Pi:

With[{r = 1}, 
  torus[{u_, v_}] := {(3 + Cos[u]) Cos[v], (3 + Cos[u]) Sin[v], 
    r Sin[u]}];
Show[ParametricPlot3D[torus[{u, v}], {u, 0, 2 \[Pi]}, {v, 0, 2 \[Pi]},
   Mesh -> None], 
 ParametricPlot3D[torus[{Pi*Sin[t], 0}], {t, 0, 2 \[Pi]}], 
 Graphics3D[{Arrowheads[0.05], 
   Arrow[Tube@{torus[{Sin[2 \[Pi]*.49], 0}], 
      torus[{Sin[2 \[Pi]*.51], 0}]}]}]]

or else replace Sin[t] with simply t:

With[{r = 1}, 
  torus[{u_, v_}] := {(3 + Cos[u]) Cos[v], (3 + Cos[u]) Sin[v], 
    r Sin[u]}];
Show[ParametricPlot3D[torus[{u, v}], {u, 0, 2 \[Pi]}, {v, 0, 2 \[Pi]},
   Mesh -> None], 
 ParametricPlot3D[torus[{t, 0}], {t, 0, 2 \[Pi]}, PlotStyle -> Black],
  Graphics3D[{Black, Arrowheads[0.05], 
   Arrow[Tube@{torus[{Sin[2 \[Pi]*.45], 0}], 
      torus[{Sin[2 \[Pi]*.51], 0}]}]}]]
POSTED BY: Gianluca Gorni
Posted 3 years ago

Hi Gianluca, I changed the parameters u, v, t from (0,1) to (0,2 Pi):

With[{r = 1}, 
  torus[{u_, v_}] := {(3 + Cos[ u]) Cos[ v], (3 + Cos[ u]) Sin[v], 
    r Sin[ u]}];
Show[ParametricPlot3D[torus[{u, v}], {u, 0, 2 \[Pi]}, {v, 0, 2 \[Pi]},
   Mesh -> None], 
 ParametricPlot3D[torus[{Sin[ t], 0}], {t, 0, 2 \[Pi]}], 
 Graphics3D[{Arrowheads[0.05], 
   Arrow[Tube@{torus[{Sin[2 \[Pi]*.5], 0}], 
      torus[{Sin[2 \[Pi]*.51], 0}]}]}]]

But get a different result?! What is wrong?

With best regards Bernd

POSTED BY: Bernd Wichmann
Posted 3 years ago

Thank you very much. I will work with the draft and if any questions arise, may I get back to you?

POSTED BY: Bernd Wichmann
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard