
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
code for Matlab used for building a Torus Knot. I used it for my programming language course for this year of school
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

phi=str2double(get(handles.edit1,'String')); q=str2double(get(handles.edit2,'String')); C=str2double(get(handles.edit3,'String')) theta=linspace(0,2pi,200); r=cos(q.theta)+2; x=r.(cos(phi.theta)); y=r.(sin(phi.theta)); z=-(sin(q.theta)); C=min((phi-1).q,(q-1).*phi) %%crossing number (r-2).^2+z.^2==1; axis(handles.axes1) cla plot3(x,y,z,'-y','LineWidth',2); axis equal axis off rotate3d on xlabel('X','fontSize',14); ylabel('Y','fontSize',14); zlabel('Z','fontsize',14); title('Torus knot','fontsize',15)