# dcmbody2wind

Convert angle of attack and sideslip angle to direction cosine matrix

## Syntax

```n = dcmbody2wind(a, b) ```

## Description

`n = dcmbody2wind(a, b)` calculates the direction cosine matrix, `n`, for given angle of attack and sideslip angle, `a`, `b`. `a` is an `m` array of angles of attack. `b` is an `m` array of sideslip angles. `n` returns a 3-by-3-by-`m` matrix containing `m` direction cosine matrices. `n` performs the coordinate transformation of a vector in body-axes into a vector in wind-axes. Angles of attack and sideslip angles are input in radians.

## Examples

Determine the direction cosine matrix from angle of attack and sideslip angle:

```alpha = 0.4363; beta = 0.1745; dcm = dcmbody2wind(alpha, beta) dcm = 0.8926 0.1736 0.4162 -0.1574 0.9848 -0.0734 -0.4226 0 0.9063```

Determine the direction cosine matrix from multiple angles of attack and sideslip angles:

```alpha = [0.4363 0.1745]; beta = [0.1745 0.0873]; dcm = dcmbody2wind(alpha, beta) dcm(:,:,1) = 0.8926 0.1736 0.4162 -0.1574 0.9848 -0.0734 -0.4226 0 0.9063 dcm(:,:,2) = 0.9811 0.0872 0.1730 -0.0859 0.9962 -0.0151 -0.1736 0 0.9848``` 