---
title: ARConfiguration.WorldAlignment.gravityAndHeading
framework: arkit
role: symbol
role_heading: Case
path: arkit/arconfiguration/worldalignment-swift.enum/gravityandheading
---

# ARConfiguration.WorldAlignment.gravityAndHeading

The coordinate system’s y-axis is parallel to gravity, its x- and z-axes are oriented to compass heading, and its origin is the initial position of the device.

## Declaration

```swift
case gravityAndHeading
```

## Discussion

Discussion The y-axis matches the direction of gravity as detected by the device’s motion sensing hardware; that is, the vector (0,-1,0) points downward. The x- and z-axes match the longitude and latitude directions as measured by Location Services. The vector (0,0,-1) points to true north and the vector (-1,0,0) points west. (That is, the positive x-, y-, and z-axes point east, up, and south, respectively.)

Although this option fixes the directions of the three coordinate axes to real-world directions, the location of the coordinate system’s origin is still relative to the device, matching the device’s position as of when the session configuration is first run. note: Using gravity and heading alignment requires tracking the device’s geographic location. Your app’s Info.plist must include user-facing text for the NSLocationUsageDescription or NSLocationWhenInUseUsageDescription key so that the user can grant your app permission for location tracking.

## See Also

### Alignments

- [ARConfiguration.WorldAlignment.gravity](arkit/arconfiguration/worldalignment-swift.enum/gravity.md)
- [ARConfiguration.WorldAlignment.camera](arkit/arconfiguration/worldalignment-swift.enum/camera.md)
