MATLAB Answers

Creating a Helix Spiral

85 views (last 30 days)
Hans123 on 19 Aug 2019
Commented: Hans123 on 19 Aug 2019
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);
grid on

Accepted Answer

Bruno Luong
Bruno Luong on 19 Aug 2019
Edited: Bruno Luong on 19 Aug 2019
r = ...
gap = ...
t = (2*pi/gap)*(0:0.001:10);
st = r*sin(t);
ct = r*cos(t);
Hans123 on 19 Aug 2019
works exactly as I want it to, thank you for the help!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!