octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62081] quiver: arrowheads damage plot (to lar


From: Rik
Subject: [Octave-bug-tracker] [bug #62081] quiver: arrowheads damage plot (to large)
Date: Fri, 18 Feb 2022 17:58:03 -0500 (EST)

Update of bug #62081 (project octave):

                  Status:                    None => Need Info              

    _______________________________________________________

Follow-up Comment #1:

Have you tried this in Matlab?

I tried the code in richtungsfeld.m in both Octave and Matlab and they produce
the same plots.  It appears that this is what is supposed to happen.

If I go to review the source code at
https://de.wikipedia.org/wiki/Richtungsfeld

it is not the same as the attached m-file.

I copied the code that is on de.wikipedia.org and organized it into one file
which is attached and shown below


1;

function richtungsfeld(dgl)
% dgl ist die erste Ableitung von y nach x und ist i.A. eine Funktion von x
und y
% Ausschnitt und Abstand zwischen den Vektoren
y = -5:.5:5; x = -5:.5:5;
for y_n = 1:length(y)
 for x_n = 1:length(x)
   len = sqrt( dgl(y(y_n), x(x_n))^2 + 1 ); % Länge des Vektors für
Normierung
   dx(y_n,x_n) = 1 / len;                   % Länge des Vektors entlang der
Abszisse
   dy(y_n,x_n) = dgl(y(y_n), x(x_n)) / len; % Länge des Vektors entlang der
Ordinate
 end
end 
h=quiver(x, y, dx, dy,0.5,"r","linewidth",1); % Vektoren zeichnen 
set (h, "maxheadsize", 0.1); 
xlabel ("x");
ylabel("y");
print('field.svg', '-dsvg')  % Plot als svg-Datei exportieren
% Ende des Files
endfunction

%source("richtungsfeld.m")
dgl = @(y, x) y-x   % Funktionsdefinition 
richtungsfeld(dgl)


It produces the plot shown on the Wikipedia page.

(file #52890)
    _______________________________________________________

Additional Item Attachment:

File name: tst_arrow_sz.m                 Size:0 KB
    <https://file.savannah.gnu.org/file/tst_arrow_sz.m?file_id=52890>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62081>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]