---
title: CMAttitude
framework: coremotion
role: symbol
role_heading: Class
path: coremotion/cmattitude
---

# CMAttitude

The device’s orientation relative to a known frame of reference at a point in time.

## Declaration

```swift
class CMAttitude
```

## Overview

Overview The CMAttitude class offers three different mathematical representations of attitude: a rotation matrix, a quaternion, and Euler angles (roll, pitch, and yaw values). You access CMAttitude objects through the attitude property of each CMDeviceMotion objects passed to an application. An application starts receiving these device-motion objects as a result of calling the startDeviceMotionUpdates(using:to:withHandler:) method, the startDeviceMotionUpdates(to:withHandler:) method, the startDeviceMotionUpdates(using:) method, or the startDeviceMotionUpdates() method of the CMMotionManager class. note: Core Motion outputs a direction cosine matrix (DCM)—basically a rotation from the last “old” orientation to the new orientation of the device.

## Topics

### Getting a Mathematical Representation of Attitude as Euler Angles

- [roll](coremotion/cmattitude/roll.md)
- [pitch](coremotion/cmattitude/pitch.md)
- [yaw](coremotion/cmattitude/yaw.md)

### Getting a Mathematical Representation of Attitude as a Rotation Matrix

- [rotationMatrix](coremotion/cmattitude/rotationmatrix.md)
- [CMRotationMatrix](coremotion/cmrotationmatrix.md)

### Getting a Mathematical Representation of Attitude as a Quaternion

- [quaternion](coremotion/cmattitude/quaternion.md)
- [CMQuaternion](coremotion/cmquaternion.md)

### Obtaining the Change in Attitude

- [multiply(byInverseOf:)](coremotion/cmattitude/multiply(byinverseof:).md)

### Initializers

- [init(coder:)](coremotion/cmattitude/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Device motion

- [Getting processed device-motion data](coremotion/getting-processed-device-motion-data.md)
- [CMDeviceMotion](coremotion/cmdevicemotion.md)
- [CMAttitudeReferenceFrame](coremotion/cmattitudereferenceframe.md)
- [CMHeadphoneMotionManager](coremotion/cmheadphonemotionmanager.md)
