Skip to content

Commit

Permalink
new demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ponsfrilus committed Jul 16, 2015
1 parent 6c003ba commit 6257730
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 0 deletions.
12 changes: 12 additions & 0 deletions octave_scr/cloud.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
t=linspace(0,5*pi,400);

x = 5 .* cos(t) - cos(5.*t);
y = 5 .* sin(t) - sin(5.*t);
z = t;

D = [x; y; z];
dlmwrite('cloud3D.txt',D',"delimiter"," ");

plot3(x,y,z,'+b');
pause

12 changes: 12 additions & 0 deletions octave_scr/flower.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
t=linspace(0,4*pi,400);

x = 2 .* sin(3.*t) .* cos(t);
y = 2 .* sin(3.*t) .* sin(t);
z = sin(3.*t);

D = [x; y; z];
dlmwrite('flower3D.txt',D',"delimiter"," ");

plot3(x,y,z,'-r');
pause

23 changes: 23 additions & 0 deletions octave_scr/plane.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

w = linspace(0,1,20);
w = w';
x = w;

y = zeros(400,1);

for i=2:20
x = [x; w];
end

for i=1:19
y(i+(i-1)*20:i+(i-1)*20+19) = w(i);
end

z = 1 - x - y;

D = [x y z];

dlmwrite('plane.txt',D,"delimiter"," ");

plot3(x(1:100), y(1:100),z(1:100),'+r',x(101:200), y(101:200),z(101:200),'+c',x(201:300), y(201:300),z(201:300),'+g',x(301:400), y(301:400),z(301:400),'+b');
pause
12 changes: 12 additions & 0 deletions octave_scr/spiral.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
t=linspace(0,7*pi,400);

x = t;
y = t.*cos(t);
z = t.*sin(t);

D = [x; y; z];
dlmwrite('spiral3D.txt',D',"delimiter"," ");

plot3(x,y,z,'+r');
pause

17 changes: 17 additions & 0 deletions octave_scr/swissroll.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
N = 1000;

r=linspace(0,1,N);

t = (3*pi/2)*(0.5+1.7*r);
x1 = t.*cos(t);
y1 = t.*sin(t);
z1 = 35*rand(1,N);

figure(1);
plot3(x1(1:250), y1(1:250), z1(1:250),'+r',x1(251:500), y1(251:500), z1(251:500),'+c',x1(501:750), y1(501:750), z1(501:750),'+g',x1(751:1000), y1(751:1000), z1(751:1000),'+b');

D = [x1; y1; z1];
dlmwrite('swiss_roll.txt',D',"delimiter"," ");

pause

0 comments on commit 6257730

Please sign in to comment.