how to create helix

21 visualizaciones (últimos 30 días)
Adil Asif
Adil Asif el 12 de Oct. de 2020
Editada: John D'Errico el 12 de Oct. de 2020
create helix with radius 2 withone revolution in xy plane and one unit in z direction

Respuestas (2)

Ameer Hamza
Ameer Hamza el 12 de Oct. de 2020
Editada: Ameer Hamza el 12 de Oct. de 2020
Try this
r = 2;
t = linspace(0, 10*pi, 1000);
x = r*cos(t);
y = r*sin(t);
z = t/(2*pi);
plot3(x, y, z);
grid on
  5 comentarios
John D'Errico
John D'Errico el 12 de Oct. de 2020
Editada: John D'Errico el 12 de Oct. de 2020
What happens after 2*pi radians? (Hint: x,y return to their original position, because sin and cos are periodic with period 2*pi.)
Therefore, at t = 0, we start the curve, where z=0. When do x and y return to the same spot? Again, at t = 2*pi. What is the value of z at that "time"?
z = (2*pi)/(2*pi) = 1
So z increments by EXACTLY one unit in z, every 2*pi units of time.
Ameer Hamza
Ameer Hamza el 12 de Oct. de 2020
@Adil, as John explained, you will move a unit distance along the z-axis for each 2*pi increment in 't'.

Iniciar sesión para comentar.


KSSV
KSSV el 12 de Oct. de 2020
Editada: KSSV el 12 de Oct. de 2020
r = 2 ;
c = 10 ;
th = linspace(0,2*pi*c,500) ;
x = r*cos(th) ;
y = r*sin(th) ;
z = c*th ;
plot3(x,y,z)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by