Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

atan2 - what and why?

310 views
Skip to first unread message

Ken Quirici

unread,
May 13, 2014, 2:25:11 PM5/13/14
to
The documentation on this, and google search results, are strange. atan is arctan - that is, the angle whose tangent is its single argument.

AFA atan2:

There is only an atan2, no asin2 or acos2.

The doc for 11g and 12c says atan2(a1, a2) is the atan of a1 and a2. This is obscure at best.

Other documentation says it's the atan of a1/a2. Oh, so that's it.

Is there some special reason for this to exist at all, and if so, does this reason cover the fact that
asin2 and acos2 don't exist?

ddf

unread,
May 13, 2014, 3:15:54 PM5/13/14
to
Read here:

http://en.wikipedia.org/wiki/Inverse_trigonometric_functions

Arctan is the only one of the three arc functions you mentioned that has a two argument variant.


David Fitzjarrell

joel garry

unread,
May 13, 2014, 4:13:32 PM5/13/14
to
On Tuesday, May 13, 2014 11:25:11 AM UTC-7, Ken Quirici wrote:

>
> Is there some special reason for this to exist at all, and if so, does this reason cover the fact that
>
> asin2 and acos2 don't exist?

So you don't divide by zero. http://en.wikipedia.org/wiki/Atan2

jg
--
@home.com is bogus.
http://webcache.googleusercontent.com/search?q=cache:8jtYRzMiy00J:www.microvation.org/index.php%3Foption%3Dcom_content%26view%3Darticle%26id%3D27:man-asks-stupid-question%26catid%3D12%26Itemid%3D106+&cd=1&hl=en&ct=clnk&gl=us&client=firefox-a

Ken Quirici

unread,
May 14, 2014, 8:58:17 AM5/14/14
to
Thanks for the reference!

Here's part of the W article:

------
In a variety of computer languages, the function atan2 is the arctangent function with two arguments. The purpose of using two arguments instead of one is to gather information on the signs of the inputs in order to return the appropriate quadrant of the computed angle, which is not possible for the single-argument arctangent function.

For any real number (e.g., floating point) arguments x and y not both equal to zero, atan2(y, x) is the angle in radians between the positive x-axis of a plane and the point given by the coordinates (x, y) on it. The angle is positive for counter-clockwise angles (upper half-plane, y > 0), and negative for clockwise angles (lower half-plane, y < 0).
-------------

Prob. the Oracle doc should mention that the arguments are not tan values but coordinates; it does
mention that specifying the two arguments enables the quadrant of the resulting angle to be determined.

Anyway thx for your replies! An interesting excursion into math.
0 new messages