Message Boards Message Boards

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

Plot mapped on a torus

Posted 1 year ago

How do you map a 2-parameter function, i.e.

ParametricPlot[{Sin[2 \[Pi] t], 0}, {t, 0, 1/2}]

onto the surface of a 2-dimensional torus?

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]}, ParametricPlot3D[torus[{u, v}], {u, 0, 1}, {v, 0, 1}]

A directional arrow is to be attached to the function.

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

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

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

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

Hello Gianluca,

thank you very much for your answer. I think I do not understand the expression torus[{Sin[2 [Pi] t], 0}]. torus[{}] demands for three coordinates, but torus[{Sin[2 [Pi] t], 0}] supplies only two. Do {Sin[2 [Pi] t], 0} reflects the variables (u,v)? i.e. the function f(x) I want to map on the torus, I set equal to one variable of the torus?

With best regards Bernd

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

Molte grazie

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

Group Abstract Group Abstract