Creating a Helix Spiral

조회 수: 48 (최근 30일)
Hans123
Hans123 2019년 8월 19일
댓글: Hans123 2019년 8월 19일
I want to create a helix sprial. I wish to have control over changing the radius of the spiral, the gap between each layer and the height of the spiral. How would I do that?
I obtained the code below from MATLAB's Documentation however I am not familiar with it. If you can explain how st and ct works that would be helpful too.
Thanks in advance
clc; clear; close all
t = 0:pi/50:10*pi;
st = sin(t);
ct = cos(t);
plot3(st,ct,t)
grid on

채택된 답변

Bruno Luong
Bruno Luong 2019년 8월 19일
편집: Bruno Luong 2019년 8월 19일
r = ...
gap = ...
t = (2*pi/gap)*(0:0.001:10);
st = r*sin(t);
ct = r*cos(t);
  댓글 수: 5
Bruno Luong
Bruno Luong 2019년 8월 19일
편집: Bruno Luong 2019년 8월 19일
gap=5 % blue distance
d=30 % black distance
r = 2;
z=linspace(0,d,1000);
t=(2*pi/gap)*z;
x=r*cos(t)
y=r*sin(t)
plot3(x,y,z)
Hans123
Hans123 2019년 8월 19일
works exactly as I want it to, thank you for the help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Plot Customization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by