Wazir
Wazir

Reputation: 110

Helix Axis of rotation in matlab

Ingeneral we create a helix using below code

t = 0:pi/50:20*pi;
st = sin(t);
ct = cos(t);
plot3(st,ct,t)

Using this code, a helix is generated. Can you tell me if there is any command though which I can see the axis of rotation as shown in below figure??

enter image description here

Upvotes: 1

Views: 331

Answers (1)

Jonas
Jonas

Reputation: 74940

As the axis of rotation is parallel to the z-axis, you can simply draw a line there:

hold on %# do not erase other plot
plot([0;0],[0;0],[t(1);t(end)],'k')

Upvotes: 1

Related Questions