HP Prime Forum
Four quadrant inverse tangent function - Printable Version

+- HP Prime Forum (http://forum.hp-prime.de)
+-- Forum: HP Prime (/forumdisplay.php?fid=1)
+--- Forum: Software (/forumdisplay.php?fid=4)
+--- Thread: Four quadrant inverse tangent function (/showthread.php?tid=70)



Four quadrant inverse tangent function - cdeaglejr - 04-03-2016 07:55 PM

This HP Prime function calculates an angle between 0 and 2 pi radians using the sin and cosine of the angle provided by the user.

It is called ATAN3 because FORTRAN has a function called ATAN2 that calculates an angle between plus and minus pi.

The syntax of this function is a follows;

EXPORT ATAN3(a, b)

// four quadrant inverse tangent

// input

// a = sine of angle
// b = cosine of angle

// output

// 0 =< angle <= 2 pi

////////////////////