RETURN(M0) ;
END ;
------------
This function works on iPhone with keyboard input (X, Y and M0 msgboxes are OK).
This function does not work in program mode with iPhone, (M0 stay [0,0] with msgbox).

The same program work exhaustively with HP Prime virtual calculator on my desktop without any problem.

Is there a bug on the new IOS HP Prime or there is a problem with my function. (With old IOS HP Prime version, funtion worked correctly).
I have uninstalled and installed IOS HP Prime, switched off an on IOS device several times without change.

I do not think that the mod 360 is a good idea.
First, ARG should only return values from 0 to 360.
Furthemore, this code is assuming degree mode (which is not a given).

(03-13-2018 09:41 AM)cyrille de brébisson Wrote: [ -> ]ARG should only return values from 0 to 360.

(03-13-2018 09:54 AM)Lamas Wrote: [ -> ]Ok, If ARG() returns the correct value (for me), I agree with you to remove "MOD 360" but it does not.

Lamas is right. They are different. In degree mode, ARG returns angles in the interval (-180,180], whereas MOD 360 returns values in the interval [0,360).

A couple of years ago I requested that atan2 be put on a list for future release enhancements. This would be useful for programs that need the inverse tangent mapped to the interval [0,2*pi). Polar coordinates, and navigation software are typical examples. It's easy to create a stand-alone program for this, but with all the other tools in the toolbox, atan2 seems like it would be a useful addition.

(03-16-2018 02:04 PM)DrD Wrote: [ -> ]A couple of years ago I requested that atan2 be put on a list for future release enhancements. This would be useful for programs that need the inverse tangent mapped to the interval [0,2*pi). Polar coordinates, and navigation software are typical examples. It's easy to create a stand-alone program for this, but with all the other tools in the toolbox, atan2 seems like it would be a useful addition.

(03-16-2018 02:04 PM)DrD Wrote: [ -> ]A couple of years ago I requested that atan2 be put on a list for future release enhancements. This would be useful for programs that need the inverse tangent mapped to the interval [0,2*pi). Polar coordinates, and navigation software are typical examples. It's easy to create a stand-alone program for this, but with all the other tools in the toolbox, atan2 seems like it would be a useful addition.

Windows 10 Pro Rev : 1709
HP Prime virtual calculator Build 2018 1 24 Rev : 13333

iPhone IOS V : 11.2.6
IOS HP Prime V : 1.4.1.13513

This function works on iPhone with keyboard input (X, Y and M0 msgboxes are OK).
This function does not work in program mode with iPhone, (M0 stay [0,0] with msgbox).

I ran the same program on iOS 11.3 with Prime Pro app 1.4.1.13513 and it works fine. Maybe the newer version of iOS fixed the problem.