fixed polar to cartesian function
updated for multidimensional shenanigans