Newsgroups: comp.robotics
Path: brunix!news.Brown.EDU!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!csn!news.den.mmc.com!iplmail!frankenstein!richardl
From: richardl@orl.mmc.com (Richard Long)
Subject: Re: ATAN2
Message-ID: <1994Jan6.020652.14269@iplmail.orl.mmc.com>
Sender: news@iplmail.orl.mmc.com (NetWork News Manager)
Reply-To: richardl@orl.mmc.com
Organization: Martin Marietta Orlando
References: <1994Jan5.114201.14061@ousrvr.oulu.fi>
Date: Thu, 6 Jan 1994 02:06:52 GMT
Lines: 30

In article 14061@ousrvr.oulu.fi, mtm@phoenix.oulu.fi (Mika T. Mammela) writes:
>What is the mathematical notation for function atan2 (commonly used
>in inverse kinematic analyses of robots) ?
>
>Mika Mammela
>mtm@phoenix.oulu.fi
>



Since atan2(y,x) returns the angle over the range (-pi,pi), one possible functional
description would be:

atan(y,x) = Arctan(y/x)-(pi/2)*H(-x)Sgn(y)

or even better,

atan(y,x) = Arccos(x/sqrt(x^2+y^2))*Sgn(y)

where H() is the Heaviside step function [0 if x<0, 1 if x>0], and Sgn() is the
signum function Sgn(y)=2*H(y)-1.  Of course, in the first case all we doing is using
H() to see if x is negative, and if not use Arctan, if so, add or subtract pi/2
depending on the sign of y.  In the second case, we use the fact that Arccos() gives
the angle in the range (0,pi), and then use Sgn() to to simply change the sign 
depending on y.  I assume you wanted something like the above for the purposes of
analysis.

Richard Long
richardl@orl.mmc.com
long@acme.ist.ucf.edu 
