bugGNU Octave - Bugs: bug #37933, quiver3 arrow heads disappear as...

 
 

bug #37933: quiver3 arrow heads disappear as dx and dy go to zero

Submitter:  None
Submitted:  Sun 16 Dec 2012 02:54:09 AM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Ted Rippert Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.3
Operating System:  * Mac OS Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 17 Dec 2012 03:50:27 PM UTC, comment #4: 

Thanks, I have implemented a patch closely inspired by your suggestion:

http://hg.savannah.gnu.org/hgweb/octave/rev/9f17e8278540

I forgot to acknowledge you in the commit message. Sorry. If this is a big problem, I can amend this.

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Sun 16 Dec 2012 11:11:39 PM UTC, comment #3: 

I think what you wanted is:



text to be as typed.


See the Site help in the left panel.

Michael Godfrey <godfrey>
Group Member
Sun 16 Dec 2012 10:10:57 PM UTC, comment #2: 

OK, last try, sorry to be annoying:
My original submission doesn't seem to show up properly on this page, but the
email looked OK, so I'll try to put it in here. I can't seem to find a way to
preview the formatted output prior to submission.
To see the issue, use this command:

octave:42> quiver3(0,0,0,0,0,1)
octave:43> hold on
octave:44> quiver3(0,0,0,0,1,0)
octave:45> quiver3(0,0,0,1,0,0)

The horizontal arrows have arrow heads, but not the vertical arrow. Actually
the head is there, but the two lines that make it up are parallel to the body
line. It turns out that the angle between the arrow head lines is
proportional
to the length of the arrow in the x-y plane, so an arrow with length only
along the z-axis appears to have no head.
I have a fix. Replace line 219 in _quiver_.m:

    zarrw1 = zarrw2 = zend - ww(:) * arrowsize;

with

    xarrw1 = xtmp + sqrt((y - yend).^2 + (z - zend).^2) * arrowsize / 3;
    xarrw2 = xtmp - sqrt((y - yend).^2 + (z - zend).^2) * arrowsize / 3;
    yarrw1 = ytmp - sqrt((x - xend).^2 + (z - zend).^2) * arrowsize / 3;
    yarrw2 = ytmp + sqrt((x - xend).^2 + (z - zend).^2) * arrowsize / 3;
    zarrw1 = zarrw2 = zend - ww(:) * arrowsize;


Ted Rippert <rip>
Sun 16 Dec 2012 10:06:10 PM UTC, comment #1: 

My original submission doesn't seem to show up properly on this page, but the email looked OK, so I'll try to put it in here. I can't seem to find a way to preview the formatted output prior to submission.
To see the issue, use this command:

octave:42> quiver3(0,0,0,0,0,1)
octave:43> hold on
octave:44> quiver3(0,0,0,0,1,0)
octave:45> quiver3(0,0,0,1,0,0)
+verbatim+
The horizontal arrows have arrow heads, but not the vertical arrow. Actually
the head is there, but the two lines that make it up are parallel to the body
line. It turns out that the angle between the arrow head lines is proportional
to the length of the arrow in the x-y plane, so an arrow with length only
along the z-axis appears to have no head.
I have a fix. Replace line 219 in __quiver__.m:
+verbatim+
     zarrw1 = zarrw2 = zend - ww(:) * arrowsize;
+verbatim+
with
+verbatim+
     xarrw1 = xtmp + sqrt((y - yend).^2 + (z - zend).^2) * arrowsize / 3;
     xarrw2 = xtmp - sqrt((y - yend).^2 + (z - zend).^2) * arrowsize / 3;
     yarrw1 = ytmp - sqrt((x - xend).^2 + (z - zend).^2) * arrowsize / 3;
     yarrw2 = ytmp + sqrt((x - xend).^2 + (z - zend).^2) * arrowsize / 3;
     zarrw1 = zarrw2 = zend - ww(:) * arrowsize;
+verbatim+

Ted Rippert <rip>
Sun 16 Dec 2012 02:54:09 AM UTC, original submission:  

To see the issue, use this command:


octave:42> quiver3(0,0,0,0,0,1)
octave:43> hold on
octave:44> quiver3(0,0,0,0,1,0)
octave:45> quiver3(0,0,0,1,0,0)
+verbatim+

The horizontal arrows have arrow heads, but not the vertical arrow. Actually the head is there, but the two lines that make it up are parallel to the body line. It turns out that the angle between the arrow head lines is proportional to the length of the arrow in the x-y plane, so an arrow with length only along the z-axis appears to have no head.

I have a fix. Replace line 219 in __quiver__.m:
+verbatim+
      zarrw1 = zarrw2 = zend - ww(:) * arrowsize;
+verbatim+
with
+verbatim+
      xarrw1 = xtmp + sqrt((y - yend).^2 + (z - zend).^2) * arrowsize / 3;
      xarrw2 = xtmp - sqrt((y - yend).^2 + (z - zend).^2) * arrowsize / 3;
      yarrw1 = ytmp - sqrt((x - xend).^2 + (z - zend).^2) * arrowsize / 3;
      yarrw2 = ytmp + sqrt((x - xend).^2 + (z - zend).^2) * arrowsize / 3;
      zarrw1 = zarrw2 = zend - ww(:) * arrowsize;
+verbatim+

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jordigh (Updated the item)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by rip (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-12-17 jordigh StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2012-12-17 jordigh StatusNone Patch Submitted

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code