supp:octave:contrib:arrow:start
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| supp:octave:contrib:arrow:start [2016/04/10 19:55] – admin | supp:octave:contrib:arrow:start [2018/11/12 16:13] (current) – [turn.m] admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | Draw vector arrows. | ||
| ===== arrow.m ===== | ===== arrow.m ===== | ||
| + | |||
| + | Draw vector arrow. | ||
| <file octave arrow.m> | <file octave arrow.m> | ||
| Line 130: | Line 132: | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ===== 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.1460318116.txt.gz · Last modified: 2016/04/10 19:55 by admin
