FAQ/atan - CBU statistics Wiki

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment
Type the odd characters out in each group: abz2a 125t7 HhHaHh year.s 5433r21 worl3d

location: FAQ / atan

Computing arctans in EXCEL

There are two functions which compute arc tangents (which computes the angle expressed in radians) of a line going from the origin to a co-ordinates in arrays X,Y.

Syntax:

P = atan2(Y,X) or P = atan(X/Y)

P = atan2(Y,X) returns an array P the same size as X and Y containing the element-by-element, four-quadrant inverse tangent (arctangent) of the real parts of Y and X. Any imaginary parts of the inputs are ignored.

Elements of P lie in the closed interval [-pi,pi], where pi is the MATLAB floating-point representation of $$\pi$$. atan uses sign(Y) and sign(X) to determine the specific quadrant.

atan2(Y,X) contrasts with atan(Y/X), whose results are limited to the interval [-pi/2, pi/2].