First I just want to say I am NOT going to use the built in command FromPolarCoordinates, I am attempting to write my own function that will do the same thing..
I currently am able to convert between one pair of polar coordinates and Cartesian with the following code and usage of replacement rules:
But what if I wanted to enter a list into my blah function, such as blah[{1,pi/4},{pi/4,pi/4}] and so on…?
I was thinking the “Switch” command might come in handy
Obviously this is wrong because all I get as an output is just bleh[{1,pi/4},{pi/4,pi/4}] but I feel like I am somewhat in the right direction. I tried to run your code but you have “polar” defined twice so there was an error.
the code I supplied works perfectly for me. I have defined blah[..] twice, but one definition is conditional (/; MatrixQ[ .. ]). This is similiar to functional overloading in C++. I am running M11.0.1 on Windows10.