<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMotion",
  "identifier" : "/documentation/CoreMotion/CMAttitude/quaternion",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Motion"
    ],
    "preciseIdentifier" : "c:objc(cs)CMAttitude(py)quaternion"
  },
  "title" : "quaternion"
}
-->

# quaternion

Returns a quaternion representing the device’s attitude.

```
var quaternion: CMQuaternion { get }
```

## Discussion

See the discussion of the [`CMQuaternion`](/documentation/CoreMotion/CMQuaternion) type in “Constants” for further information.

## See Also

[`rotationMatrix`](/documentation/CoreMotion/CMAttitude/rotationMatrix)

Returns a rotation matrix representing the device’s attitude.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)