symbolic icon indicating copy to clipboard operation
symbolic copied to clipboard

add cart2pol function and friends

Open cbm755 opened this issue 7 years ago • 12 comments

Presumably this just calls atan2 and hypot...

Could also investigate whether upstream Octave can be improved to make these "just work" on any class that has atan2 and hypot.

cbm755 avatar Feb 15 '18 18:02 cbm755

I think this is already in octave. Does SMT have a symbolic version of it? I can't find any SMT documentation mentioning cart2pol.

alexvong243f avatar Jul 17 '22 20:07 alexvong243f

No problem, we can just add it anyway for convenience

alexvong243f avatar Jul 17 '22 20:07 alexvong243f

Does the built-in one work with symbolic input?

I don't think the built-in one works with symbolic input:

>> cart2pol(sym(4),sym(5))
error: cart2pol: X, Y must be numeric arrays of the same size, or scalar
error: called from
    cart2pol at line 67 column 7

cbm755 avatar Jul 18 '22 01:07 cbm755

I want to work on this issue Please guide me in solving this issue Sir, I am new to Open Source Please tell me what thing I have to do first

OmkarTipugade avatar Sep 13 '23 19:09 OmkarTipugade

@OmkarTipugade, sounds great. @alexvong243f added cart2pol.

There are still three functions on this list:

  • pol2cart
  • cart2sph
  • sph2cart

I suggest you start with pol2cart. Go look at inst/@sym/cart2pol.m, copy it and modify it. You should read help pol2cart (to understand what the double precision function does).


Note these functions have a HUGE amount of "boilerplate" code but for example the basic operation in cart2pol is just these two lines:

  r = hypot (sym (x), sym (y));
  theta = atan2 (sym (y), sym (x));

cbm755 avatar Sep 14 '23 06:09 cbm755

Thank you so much for replaying me.

Sir, please send a link - help pol2cart

On Thu, Sep 14, 2023 at 12:09 PM Colin B. Macdonald < @.***> wrote:

@OmkarTipugade https://github.com/OmkarTipugade, sounds great. @alexvong243f https://github.com/alexvong243f added cart2pol.

There are still three functions on this list:

  • pol2cart
  • cart2sph
  • sph2cart

I suggest you start with pol2cart. Go look at @.***/cart2pol.m, copy it and modify it. You should read help pol2cart (to understand what the double precision function does).

Note these functions have a HUGE amount of "boilerplate" code but for example the basic operation in cart2pol is just these two lines:

r = hypot (sym (x), sym (y)); theta = atan2 (sym (y), sym (x));

— Reply to this email directly, view it on GitHub https://github.com/gnu-octave/symbolic/issues/865#issuecomment-1718849236, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3BAYSKQYRPQKGQ6DW7LWZTX2KRDRANCNFSM4EQ5GCBQ . You are receiving this because you were mentioned.Message ID: @.***>

OmkarTipugade avatar Sep 14 '23 16:09 OmkarTipugade

please send a link - help pol2cart

help pol2cart is a command to type into GNU Octave. You will definitely need to be familiar with Octave to make progress within this project.

Some other resources include our wiki https://github.com/gnu-octave/symbolic/wiki and perhaps internet searches such "how to contribute to free and open source software".

cbm755 avatar Sep 14 '23 16:09 cbm755

Sir, my task is to add the pol2cart function, which transforms polar coordinates into cartesian coordinates Sir, am I right?

On Thu, Sep 14, 2023 at 9:59 PM Colin B. Macdonald @.***> wrote:

please send a link - help pol2cart

help pol2cart is a command to type into GNU Octave. You will definitely need to be familiar with Octave to make progress within this project.

Some other resources include our wiki https://github.com/gnu-octave/symbolic/wiki and perhaps internet searches such "how to contribute to free and open source software".

— Reply to this email directly, view it on GitHub https://github.com/gnu-octave/symbolic/issues/865#issuecomment-1719774734, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3BAYSITSA5IU6ICV56UXJTX2MWFHANCNFSM4EQ5GCBQ . You are receiving this because you were mentioned.Message ID: @.***>

OmkarTipugade avatar Sep 15 '23 06:09 OmkarTipugade