source:
orbit/iOS/Orbit/CoreMotion.framework/Headers/CMAttitude.h
@
876e42b
Last change on this file since 876e42b was 876e42b, checked in by Steve Castellotti <sc@…>, 6 years ago  



File size: 3.4 KB 
Line  

1  /* 
2  * CMAttitude.h 
3  * CoreMotion 
4  * 
5  * Copyright (c) 2010 Apple Inc. All rights reserved. 
6  * 
7  */ 
8  
9  #import <Foundation/Foundation.h> 
10  
11  /* 
12  * CMRotationMatrix 
13  * 
14  * Discussion: 
15  * Type represents a rotation matrix. 
16  */ 
17  typedef struct 
18  { 
19  double m11, m12, m13; 
20  double m21, m22, m23; 
21  double m31, m32, m33; 
22  } CMRotationMatrix; 
23  
24  /* 
25  * CMQuaternion 
26  * 
27  * Discussion: 
28  * Type represents a quaternion (one way of parameterizing attitude). If q 
29  * is an instance of CMQuaternion, mathematically it represents the 
30  * following quaternion: 
31  * q.x*i + q.y*j + q.z*k + q.w 
32  * 
33  */ 
34  typedef struct 
35  { 
36  double x, y, z, w; 
37  } CMQuaternion; 
38  
39  /* 
40  * CMAttitudeReferenceFrame 
41  * 
42  * Discussion: 
43  * CMAttitudeReferenceFrame indicates the reference frame from which all CMAttitude 
44  * samples are referenced. 
45  * 
46  * Definitions of each reference frame is as follows: 
47  *  CMAttitudeReferenceFrameXArbitraryZVertical describes a reference frame in 
48  * which the Z axis is vertical and the X axis points in an arbitrary direction 
49  * in the horizontal plane. 
50  *  CMAttitudeReferenceFrameXArbitraryCorrectedZVertical describes the same reference 
51  * frame as CMAttitudeReferenceFrameXArbitraryZVertical with the following exception: 
52  * when available and calibrated, the magnetometer will be used to correct for accumulated 
53  * yaw errors. The downside of using this over CMAttitudeReferenceFrameXArbitraryZVertical 
54  * is increased CPU usage. 
55  *  CMAttitudeReferenceFrameXMagneticNorthZVertical describes a reference frame 
56  * in which the Z axis is vertical and the X axis points toward magnetic north. 
57  * Note that using this reference frame may require device movement to 
58  * calibrate the magnetometer. 
59  *  CMAttitudeReferenceFrameXTrueNorthZVertical describes a reference frame in 
60  * which the Z axis is vertical and the X axis points toward true north. 
61  * Note that using this reference frame may require device movement to 
62  * calibrate the magnetometer. 
63  */ 
64  typedef enum { 
65  CMAttitudeReferenceFrameXArbitraryZVertical = 1 << 0, 
66  CMAttitudeReferenceFrameXArbitraryCorrectedZVertical = 1 << 1, 
67  CMAttitudeReferenceFrameXMagneticNorthZVertical = 1 << 2, 
68  CMAttitudeReferenceFrameXTrueNorthZVertical = 1 << 3 
69  } CMAttitudeReferenceFrame; 
70  
71  NS_CLASS_AVAILABLE(NA,4_0) 
72  @interface CMAttitude : NSObject <NSCopying, NSSecureCoding> 
73  { 
74  @private 
75  id _internal; 
76  } 
77  
78  /* 
79  * roll 
80  * 
81  * Discussion: 
82  * Returns the roll of the device in radians. 
83  * 
84  */ 
85  @property(readonly, nonatomic) double roll; 
86  
87  /* 
88  * pitch 
89  * 
90  * Discussion: 
91  * Returns the pitch of the device in radians. 
92  * 
93  */ 
94  @property(readonly, nonatomic) double pitch; 
95  
96  /* 
97  * yaw 
98  * 
99  * Discussion: 
100  * Returns the yaw of the device in radians. 
101  * 
102  */ 
103  @property(readonly, nonatomic) double yaw; 
104  
105  /* 
106  * rotationMatrix 
107  * 
108  * Discussion: 
109  * Returns a rotation matrix representing the device's attitude. 
110  * 
111  */ 
112  @property(readonly, nonatomic) CMRotationMatrix rotationMatrix; 
113  
114  /* 
115  * quaternion 
116  * 
117  * Discussion: 
118  * Returns a quaternion representing the device's attitude. 
119  * 
120  */ 
121  @property(readonly, nonatomic) CMQuaternion quaternion; 
122  
123  /* 
124  * multiplyByInverseOfAttitude: 
125  * 
126  * Discussion: 
127  * Multiplies attitude by the inverse of the specified attitude. This gives 
128  * the attitude change from the specified attitude. 
129  */ 
130   (void)multiplyByInverseOfAttitude:(CMAttitude *)attitude; 
131  
132  @end 
Note: See TracBrowser
for help on using the repository browser.