bugGNU Octave - Bugs: bug #55446, Implementation of lightangle

 
 

bug #55446: Implementation of lightangle

Submitter:  Guillaume <gyom>
Submitted:  Fri 11 Jan 2019 12:34:08 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 22 Jan 2019 06:37:03 AM UTC, comment #5: 

I made two small changes here (https://hg.savannah.gnu.org/hgweb/octave/rev/26a3861a34b6).  First, I moved the input validation ahead of the code that might create a figure so that a bad input doesn't leave an orphan figure.  Second, I added input validation BIST tests for AZ and EL.

Marking bug as fixed and closing report.

Rik <rik5>
Group administrator
Mon 14 Jan 2019 09:27:17 PM UTC, comment #4: 

Thanks again for your contribution. I added the new file to the build system, included the docstring in the manual and pushed it with very minor changes to default here:
http://hg.savannah.gnu.org/hgweb/octave/rev/aea4e66eb331

If someone thinks this could still go to stable, we can graft the changeset to there.

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Mon 14 Jan 2019 01:01:18 PM UTC, comment #3: 

Thanks both. I attach a new patch in which I tried to take all the feedbacks into account. For the trailing whitespace in empty lines, I was hoping that "Indent Code" in the Octave editor would do that automatically but apparently not. I didn't make a change in the NEWS file as I was not sure whether it would be for 5.0 or 6.0.

(file #45970)

Guillaume <gyom>
Sat 12 Jan 2019 12:44:43 PM UTC, comment #2: 

Thanks for your contribution. A couple of (minor) remarks:
- Instead of your local function "islight", I think you could just use isgraphics (h, "light"). The same for the test: Instead of asserting the type, you could use isgraphics with the type argument.
- Could you please add some documentation for the various input and output argument options?
- Maybe test for specific error messages in the BISTs (see e.g. in "camlight").
- It would be nice if you could create a full changeset that adds this function at the location Kai indicated.

Markus Mützel <mmuetzel>
Group administrator
Fri 11 Jan 2019 02:10:47 PM UTC, comment #1: 

Thank you for the implementation.  I am no expert on this, but except for trailing whitespace in the empty lines the code looks great. Tests included and work:


>> test lightangle
PASSES 5 out of 5 tests


(openSUSE 15.0, Octave 5.0.1, hg id 02a9e1bb314a)

This one can go to "/scripts/plot/draw" I think.

Kai Torben Ohlhus <siko1056>
Group Member
Fri 11 Jan 2019 12:34:08 PM UTC, original submission:  

Matlab has a 'lightangle' function:
https://www.mathworks.com/help/matlab/ref/lightangle.html
I attach a suggestion of implementation.

Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45970:  lightangle.patch added by gyom (5KiB - text/x-patch)
file #45934:  lightangle.m added by gyom (4KiB - text/x-matlab)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by gyom (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 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-22 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2019-01-14 mmuetzel StatusPatch Submitted Ready For Test
    2019-01-14 gyom Attached File- Added lightangle.patch, #45970
    2019-01-12 jwe Item GroupMatlab Compatibility Feature Request
    2019-01-12 mmuetzel Severity1 - Wish 3 - Normal
        Item GroupFeature Request Matlab Compatibility
    2019-01-12 jwe Severity3 - Normal 1 - Wish
        Item GroupMatlab Compatibility Feature Request
    2019-01-11 siko1056 StatusNone Patch Submitted
    2019-01-11 gyom Attached File- Added lightangle.m, #45934

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code