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

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

[Octave-bug-tracker] [bug #57794] cart2sph, sph2cart: output argument sh


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #57794] cart2sph, sph2cart: output argument should not change behavior with different nargout
Date: Wed, 12 Feb 2020 23:19:25 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36

Follow-up Comment #3, bug #57794 (project octave):

i worked up a compatible cart2sph (attached).  the output is never an array.
it returns t, p, and r according to the number of outputs requested. 

Rereading the original help text, I think I was overthinking the statement
"each row of C represents the Cartesian coordinate (x, y, z)".  I had
interpreted the text to mean row 1 was x, row 2 was y, and 3 was z.  What I
guess it means is each row is an independent ordered triplet (x,y,z).

The revised function allows 3-input arrays to be any dimension as long as they
all match, and a single matrix input follows the convention above. It must
have three columns, one for x, y, and z, but any number of rows.

Note that one alternative would be to always create a matrix output for a
matrix input, but it was simpler to keep it the way it's described above.

Expanded the help text a bit to to clarify the coordinate convention and
transformation used. 

I'll take a peek at sph2cart, as well as the pol2cart/cart2pol functions a bit
later then work up a patch.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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