Availability

See Also

Declaration

Discussion

A yaw is a rotation around an axis that runs vertically through the device. It is perpendicular to the body of the device, with its origin at the center of gravity and directed toward the bottom of the device.

Declaration

Parameters

attitude

An object representing the device’s attitude at a given moment of measurement.

Discussion

This method multiplies the inverse of the specified CMAttitude object by the attitude represented by the receiving object. It replaces the receiving instance with the attitude change relative to the object passed in attitude. You should cache the CMAttitude instance you want to use as a reference and pass that object as the argument to subsequent calls of this method.

Declaration

Constants

x

x

A value for the X-axis.

y

y

A value for the Y-axis.

z

z

A value for the Z-axis.

w

w

A value for the W-axis.

Discussion

A quaternion offers a way to parameterize attitude. If q is an instance of CMQuaternion, mathematically it represents the following unit quaternion: q.x*i + q.y*j + q.z*k + q.w. A unit quaternion represents a rotation of theta radians about the unit vector {x,y,z}, and {q.x, q.y, q.z, q.w} satisfies the following:

Constants

Describes a reference frame in which the Z axis is vertical and the X axis points in an arbitrary direction in the horizontal plane.

Available in iOS 5.0 and later.

CMAttitudeReferenceFrameXArbitraryCorrectedZVertical

CMAttitudeReferenceFrameXArbitraryCorrectedZVertical

Describes the same reference frame as CMAttitudeReferenceFrameXArbitraryZVertical except that the magnetometer, when available and calibrated, is used to improve long-term yaw accuracy. Using this constant instead of CMAttitudeReferenceFrameXArbitraryZVertical results in increased CPU usage.

Available in iOS 5.0 and later.

CMAttitudeReferenceFrameXMagneticNorthZVertical

CMAttitudeReferenceFrameXMagneticNorthZVertical

Describes a reference frame in which the Z axis is vertical and the X axis points toward magnetic north. Note that using this reference frame may require device movement to calibrate the magnetometer.

Available in iOS 5.0 and later.

CMAttitudeReferenceFrameXTrueNorthZVertical

CMAttitudeReferenceFrameXTrueNorthZVertical

Describes a reference frame in which the Z axis is vertical and the X axis points toward true north. Note that using this reference frame may require device movement to calibrate the magnetometer. It also requires the location to be available in order to calculate the difference between magnetic and true north.