
Helping to create animated wrapping line on a torus
5 views (last 30 days)
Show older comments
I am trying to draw the following situation but I couldn't since I don't know how to make the animation and to combine multible surfaces.
So my picture consists of two objects:
In the bottom of the page, a torus with animated "irrational" line wrapping the torus like this video
And above this torus, a pipe (cylindrical line) animated simultaneously with wrapping line in the tours. (For example like this video but in our situation the pipe doesn't close up!)
Note: Maybe here is usful parametric equation:
For the wrapping line: t = linspace(0,100);
x = cos(sqrt(2)*t)(3+cos(t));
y = sin(sqrt(2)*t)(3+cos(t));
z = sin(t)
--------------------------------------------------------------------------------
For the torus:
for j=1:21
for i=1:41
phi = (i-1)*2*pi/40;
theta = (j-1)*2*pi/20;
tx(i,j)= cos(phi) * (R+cos(theta)*a);
ty(i,j)= sin(phi) * (R+cos(theta)*a);
tz(i,j)= sin(theta)*a;
However, for the animated wrapping pipe, I don't know how to do it, but it should be the same as for the wrapping line
but instead of a line we need a cylinder!
Thank you very much!
0 Comments
Answers (1)
darova
on 16 Jun 2019
Read about surf() and meshgrid() to plot torus
Simple example for animation (actually it's just drawing new object in time)
Read about plot3() and think how to adapt it for your case
x0 = 0;
y0 = x0^2;
axis([0 10 0 100])
hold on
for x = linspace(0,10,20);
x1 = x;
y1 = x1^2;
plot([x0 x1],[y0 y1],'.-r') % draw new line
x0 = x1;
y0 = y1;
pause(0.1) % wait a minute
end
hold off

0 Comments
See Also
Categories
Find more on Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!