Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

atan2d

Four-quadrant inverse tangent in degrees

Syntax

Description

example

D = atan2d(Y,X) returns the four-quadrant inverse tangent (tan-1) of Y and X, which must be real. The result, D, is expressed in degrees.

Examples

collapse all

Inverse Tangent of Four Points on the Unit Circle

x = [1 0 -1 0];
y = [0 1 0 -1];
d = atan2d(y,x)
d =

     0    90   180   -90

Input Arguments

collapse all

Yy-coordinatesscalar | vector | matrix | multidimensional array

y-coordinates, specified as a scalar, vector, matrix, or multidimensional array. Inputs Y and X must be the same size unless one is a scalar. A scalar value expands to be the same size as the other array.

Data Types: single | double

Xx-coordinatesscalar | vector | matrix | multidimensional array

x-coordinates, specified as a scalar, vector, matrix, or multidimensional array. Inputs Y and X must be the same size unless one is a scalar. A scalar value expands to be the same size as the other array.

Data Types: single | double

More About

collapse all

Four-Quadrant Inverse Tangent

The four-quadrant inverse tangent, atan2d(Y,X), returns values in the closed interval [-180,180] based on the values of Y and X as shown in the graphic.

In contrast, atand(Y/X) returns results that are limited to the interval [-90,90], shown on the right side of the diagram.

See Also

| | | |

Introduced in R2012b

Was this topic helpful?