---
title: "azimuthUnitVector(in:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitouch/azimuthunitvector(in:)"
---

# azimuthUnitVector(in:)

Returns a unit vector that points in the direction of the azimuth of the stylus.

## Declaration

```swift
func azimuthUnitVector(in view: UIView?) -> CGVector
```

## Parameters

- `view`: The view that contains the stylus’s touch. Pass nil to get the unit vector for the azimuth that is relative to the touch’s window.

## Return Value

Return Value The unit vector that points in the direction of the azimuth of the stylus.

## Discussion

Discussion It is less expensive to get the azimuth unit vector than the azimuth angle. If you’re creating transform matrices, the unit vector can also be more useful.

## See Also

### Getting touch attributes

- [tapCount](uikit/uitouch/tapcount.md)
- [timestamp](uikit/uitouch/timestamp.md)
- [type](uikit/uitouch/type.md)
- [UITouch.TouchType](uikit/uitouch/touchtype.md)
- [phase](uikit/uitouch/phase-swift.property.md)
- [UITouch.Phase](uikit/uitouch/phase-swift.enum.md)
- [force](uikit/uitouch/force.md)
- [maximumPossibleForce](uikit/uitouch/maximumpossibleforce.md)
- [altitudeAngle](uikit/uitouch/altitudeangle.md)
- [azimuthAngle(in:)](uikit/uitouch/azimuthangle(in:).md)
- [rollAngle](uikit/uitouch/rollangle.md)
