gnu-octave / symbolic

A Symbolic Package for Octave using SymPy
https://octave.sourceforge.io/symbolic/
GNU General Public License v3.0
160 stars 37 forks source link

add cart2pol function and friends #865

Open cbm755 opened 6 years ago

cbm755 commented 6 years ago

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.

alexvong243f commented 2 years ago

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 commented 2 years ago

No problem, we can just add it anyway for convenience

cbm755 commented 2 years ago

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
OmkarTipugade commented 1 year ago

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

cbm755 commented 1 year ago

@OmkarTipugade, sounds great. @alexvong243f added cart2pol.

There are still three functions on this list:

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).


OmkarTipugade commented 1 year ago

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: @.***>

cbm755 commented 1 year ago

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".

OmkarTipugade commented 1 year ago

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: @.***>

Sonu0305 commented 1 week ago

Implementation of pol2cart Function

Hi @cbm755,

As per my understanding, I went through the help documentation by running the help pol2cart command and noticed that the pol2cart function has yet to be implemented. From my understanding, the pol2cart function is designed to convert polar coordinates to Cartesian coordinates.

I would like to propose implementing this function. However, before proceeding, I wanted to confirm the following details:

I would appreciate your confirmation and any additional guidance on how to proceed. Looking forward to your feedback! Thank You!