Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

# atan2d

## Description

example

D = atan2d(Y,X) returns the four-quadrant inverse tangent of points specified in the x-y plane. The result, D, is expressed in degrees.

## Examples

expand 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

expand all

### Y — y-coordinatesscalar value | vector | matrix | N-D array

y-coordinates, specified as a real-valued scalar, vector, matrix, or N-D array.

Data Types: single | double

### X — x-coordinatesscalar value | vector | matrix | N-D array

x-coordinates, specified as a real-valued scalar, vector, matrix, or N-D array.

Data Types: single | double

## Output Arguments

expand all

### D — Angles in degreesscalar value | vector | matrix | N-D array

Angles in degrees, returned as a scalar, vector, matrix, or N-D array. These angles correspond to the points defined by X and Y, and they lie in the closed interval [–180,180].