supp:octave:contrib:arrow:start
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
supp:octave:contrib:arrow:start [2016/04/10 19:45] – created admin | supp:octave:contrib:arrow:start [2018/11/12 16:13] (current) – [turn.m] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | Draw vector | + | |
+ | |||
+ | ===== arrow.m ===== | ||
+ | |||
+ | Draw vector | ||
<file octave arrow.m> | <file octave arrow.m> | ||
Line 76: | Line 80: | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== arrow_test.m ===== | ||
+ | |||
+ | Draw three vector arrows connecting points. | ||
+ | |||
+ | <file octave arrowtest.m> | ||
+ | |||
+ | ## Copyright (C) 2011 rolf.becker | ||
+ | ## | ||
+ | ## This program is free software; you can redistribute it and/or modify | ||
+ | ## it under the terms of the GNU General Public License as published by | ||
+ | ## the Free Software Foundation; either version 2 of the License, or | ||
+ | ## (at your option) any later version. | ||
+ | ## | ||
+ | ## This program is distributed in the hope that it will be useful, | ||
+ | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
+ | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
+ | ## GNU General Public License for more details. | ||
+ | ## | ||
+ | ## You should have received a copy of the GNU General Public License | ||
+ | ## along with Octave; see the file COPYING. | ||
+ | ## < | ||
+ | |||
+ | ## arrow_test | ||
+ | |||
+ | ## Author: rolf.becker < | ||
+ | ## Created: 2011-04-04 | ||
+ | |||
+ | function [ ret ] = arrow_test () | ||
+ | P0=[0 0]'; | ||
+ | P1=[1 1]'; | ||
+ | P2=[-1 1]'; | ||
+ | P3=[-1 -1]'; | ||
+ | |||
+ | scale=0.1; | ||
+ | style=2; | ||
+ | lw=2; | ||
+ | |||
+ | arrow(P0, | ||
+ | hold on | ||
+ | arrow(P0+P1, | ||
+ | arrow(P0+P1+P2, | ||
+ | hold off | ||
+ | |||
+ | axis equal | ||
+ | axis square | ||
+ | grid on | ||
+ | |||
+ | endfunction | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ===== turn.m ===== | ||
+ | |||
+ | {{: | ||
+ | |||
+ | <file octave turn.m> | ||
+ | ## Copyright (C) 2018 rolf.becker | ||
+ | ## | ||
+ | ## This program is free software; you can redistribute it and/or modify | ||
+ | ## it under the terms of the GNU General Public License as published by | ||
+ | ## the Free Software Foundation; either version 2 of the License, or | ||
+ | ## (at your option) any later version. | ||
+ | ## | ||
+ | ## This program is distributed in the hope that it will be useful, | ||
+ | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
+ | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
+ | ## GNU General Public License for more details. | ||
+ | ## | ||
+ | ## You should have received a copy of the GNU General Public License | ||
+ | ## along with Octave; see the file COPYING. | ||
+ | ## < | ||
+ | |||
+ | ## turn | ||
+ | |||
+ | ## Author: rolf.becker < | ||
+ | ## Created: 2018-11-12 | ||
+ | |||
+ | function [ ret ] = turn () | ||
+ | scl = 0.4; | ||
+ | lw = 3; | ||
+ | sty = 2; | ||
+ | n = 16; | ||
+ | |||
+ | Z = [0 0]'; | ||
+ | P1 = [2 0]'; | ||
+ | P2 = [0 1]'; | ||
+ | M = 2*[1 1]'; | ||
+ | |||
+ | phi=2*pi/ | ||
+ | R=( [cos(phi) -sin(phi) ; sin(phi) cos(phi)] ); | ||
+ | |||
+ | for i=0:n | ||
+ | arrow(Z, | ||
+ | axis([-5 5 -5 5]) | ||
+ | axis square | ||
+ | hold on | ||
+ | arrow(M, | ||
+ | arrow(M, | ||
+ | hold off | ||
+ | grid on | ||
+ | set(gca," | ||
+ | % title(" | ||
+ | xlabel(" | ||
+ | ylabel(" | ||
+ | |||
+ | M=R*M; | ||
+ | P1=R*P1; | ||
+ | P2=R*P2; | ||
+ | sleep(0.1); | ||
+ | endfor | ||
+ | endfunction | ||
+ | </ | ||
+ | |||
+ |
supp/octave/contrib/arrow/start.1460317547.txt.gz · Last modified: 2016/04/10 19:45 by admin