User Tools

Site Tools


supp:octave:contrib:arrow:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
supp:octave:contrib:arrow:start [2016/04/10 19:55] adminsupp:octave:contrib:arrow:start [2016/04/10 19:59] – [Arrow Vector] admin
Line 1: Line 1:
-====== Arrow ======+====== Draw Vector Arrows ====== 
  
-Draw vector arrows. 
  
 ===== arrow.m ===== ===== arrow.m =====
 +
 +Draw vector arrow.
  
 <file octave arrow.m> <file octave arrow.m>
Line 130: Line 132:
  
 </file> </file>
 +
 +===== turn.m =====
 +
 +Rotate three vectors by means of rotation matrix.
 +
 +<file octave turn.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.  See the
 +## 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.  If not, see
 +## <http://www.gnu.org/licenses/>.
 +
 +## turn
 +
 +## Author: rolf.becker <rolf.becker@NB-RB>
 +## Created: 2011-04-04
 +
 +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/n;
 + R=( [cos(phi) -sin(phi) ; sin(phi) cos(phi)] );
 +
 + for i=0:n
 + arrow(Z,M,scl,sty,lw)
 + hold on
 + arrow(M,M+P1,scl,sty,lw)
 + arrow(M,M+P2,scl,sty,lw)
 + hold off
 + grid on
 + axis([-5 5 -5 5])
 + set(gca,"fontsize",24,"xtick",-5:5,"ytick",-5:5)
 + axis equal
 + axis square
 +% title("Rotating Vectors");
 + xlabel("x");
 + ylabel("y");
 +
 + M=R*M;
 + P1=R*P1;
 + P2=R*P2;
 + sleep(0.001);
 + endfor
 +endfunction
 +
 +</file>
 +
 +
supp/octave/contrib/arrow/start.txt · Last modified: 2018/11/12 16:13 by admin