Polar and Rectangular conversion - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Polar and Rectangular conversion (/thread-11128.html) Polar and Rectangular conversion - DrD - 07-26-2018 07:01 PM rectangular_coordinates(-(sqrt(2)),(π/4)) ==> [-1,-1] polar_coordinates(-1,-1) ==> [sqrt(2),(3/4)*π] polar_coordinates([-1,-1]) ==> [sqrt(2),(-3/4)*π] polar_coordinates() expects a point, and returns a vector. rectangular_coordinates() expects a vector and returns a vector. This is confusing for infrequent users of these commands. The polar_coordinates() command can lead to an incorrect result, if a vector is supplied as the argument, such as might be the case if the result of rectangular_coordinates() was being re-used there. NOTE: I was using the emulator, and I have been noticing some odd behaviors (including the above). After performing a reset, I am now getting the same result from polar_coordinates() whether or not a point or vector is used. I apologize for this diversion! -Dale- RE: Polar and Rectangular conversion - Stevetuc - 07-27-2018 04:47 AM (07-26-2018 07:01 PM)DrD Wrote:  rectangular_coordinates(-(sqrt(2)),(π/4)) ==> [-1,-1] polar_coordinates(-1,-1) ==> [sqrt(2),(3/4)*π] polar_coordinates([-1,-1]) ==> [sqrt(2),(-3/4)*π] polar_coordinates() expects a point, and returns a vector. rectangular_coordinates() expects a vector and returns a vector. This is confusing for infrequent users of these commands. The polar_coordinates() command can lead to an incorrect result, if a vector is supplied as the argument, such as might be the case if the result of rectangular_coordinates() was being re-used there. polar_coordinates([-1,-1]) ==> [sqrt(2),(-3/4)*π] is correct. The original polar coordinate -(sqrt(2)),(π/4) has a rotation of π added due to the negative sign of the magnitude. The angle sum (π+π/4) can be written +5/4*π or -3/4*π which is the result given by polar_coordinates([-1,-1]) Using polar_coordinates without the vector is omitting the sign of the angle. RE: Polar and Rectangular conversion - ijabbott - 07-27-2018 10:54 AM (07-26-2018 07:01 PM)DrD Wrote:  polar_coordinates(-1,-1) ==> [sqrt(2),(3/4)*π] polar_coordinates([-1,-1]) ==> [sqrt(2),(-3/4)*π] I was confused why those gave different results, but it's a typo. They give the same (expected) result: $$\begin{bmatrix} \sqrt 2& -\frac{3}{4}\ast\pi \end{bmatrix}$$.