Created
September 21, 2012 20:59
-
-
Save akastrin/3763861 to your computer and use it in GitHub Desktop.
Helix construction in Matlab.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can we know what are the parameters