Skip to content

Instantly share code, notes, and snippets.

@akastrin
Created Sep 21, 2012
Embed
What would you like to do?
Helix construction in Matlab.
clear all; clc
a=1;
b=0.1;
w=1;
t=linspace(0,5*pi,500);
x=a*cos(w*t);
y=a*sin(w*t);
z=b*t;
plot3(x,y,z)
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')
title('x = 2 cos(t), y = 2 sin(t), z = 0.1t.')
R = 1;
% Point 1
lambda1 = sqrt((2*pi*R)^2 +b^2) * 0.4
x1=a*cos(w*lambda1);
y1=a*sin(w*lambda1);
z1=b*lambda1;
hold on
plot3(x1,y1,z1,'.', 'MarkerSize', 20)
% Point 2
lambda2 = sqrt((2*pi*R)^2 +b^2) * 0.6
x2=a*cos(w*lambda2);
y2=a*sin(w*lambda2);
z2=b*lambda2;
hold on
plot3(x2,y2,z2,'.', 'MarkerSize', 20)
% Point 3
lambda3 = sqrt((2*pi*R)^2 +b^2) * 1.2
x3=a*cos(w*lambda3);
y3=a*sin(w*lambda3);
z3=b*lambda3;
hold on
plot3(x3,y3,z3,'.', 'MarkerSize', 20)
@kalyanchary
Copy link

kalyanchary commented Jul 5, 2018

can we know what are the parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment