]> Creatis software - CreaPhase.git/blob - octave_packages/quaternion-2.0.0/doc-cache
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / quaternion-2.0.0 / doc-cache
1 # Created by Octave 3.6.1, Mon Apr 02 12:18:12 2012 UTC <root@t61>
2 # name: cache
3 # type: cell
4 # rows: 3
5 # columns: 5
6 # name: <cell-element>
7 # type: sq_string
8 # elements: 1
9 # length: 5
10 q2rot
11
12
13 # name: <cell-element>
14 # type: sq_string
15 # elements: 1
16 # length: 814
17  -- Function File: [AXIS, ANGLE] = q2rot (Q)
18      Extract vector/angle form of a unit quaternion Q.
19
20      *Inputs*
21     Q
22           Unit quaternion describing the rotation.
23
24      *Outputs*
25     AXIS
26           Eigenaxis as a 3-d unit vector `[x, y, z]'.
27
28     ANGLE
29           Rotation angle in radians.  The positive direction is
30           determined by the right-hand rule applied to AXIS.
31
32      *Example*
33           octave:1> axis = [0, 0, 1]
34           axis =
35              0   0   1
36           octave:2> angle = pi/4
37           angle =  0.78540
38           octave:3> q = rot2q (axis, angle)
39           q = 0.9239 + 0i + 0j + 0.3827k
40           octave:4> [vv, th] = q2rot (q)
41           vv =
42              0   0   1
43           th =  0.78540
44           octave:5> theta = th*180/pi
45           theta =  45.000
46           octave:6>
47
48
49
50
51
52 # name: <cell-element>
53 # type: sq_string
54 # elements: 1
55 # length: 49
56 Extract vector/angle form of a unit quaternion Q.
57
58
59
60 # name: <cell-element>
61 # type: sq_string
62 # elements: 1
63 # length: 2
64 qi
65
66
67 # name: <cell-element>
68 # type: sq_string
69 # elements: 1
70 # length: 355
71  @deftypefn {Function File} {} qi
72  Create x-component of a quaternion's vector part.
73
74  @example
75  q = w + x*qi + y*qj + z*qk
76  @end example
77
78  @strong{Example}
79  @example
80  @group
81  octave:1> q1 = quaternion (1, 2, 3, 4)
82  q1 = 1 + 2i + 3j + 4k
83  octave:2> q2 = 1 + 2*qi + 3*qj + 4*qk
84  q2 = 1 + 2i + 3j + 4k
85  octave:3> 
86  @end group
87  @end example
88
89  @end deftypefn
90
91
92
93 # name: <cell-element>
94 # type: sq_string
95 # elements: 1
96 # length: 80
97  @deftypefn {Function File} {} qi
98  Create x-component of a quaternion's vector p
99
100
101
102 # name: <cell-element>
103 # type: sq_string
104 # elements: 1
105 # length: 2
106 qj
107
108
109 # name: <cell-element>
110 # type: sq_string
111 # elements: 1
112 # length: 355
113  @deftypefn {Function File} {} qj
114  Create y-component of a quaternion's vector part.
115
116  @example
117  q = w + x*qi + y*qj + z*qk
118  @end example
119
120  @strong{Example}
121  @example
122  @group
123  octave:1> q1 = quaternion (1, 2, 3, 4)
124  q1 = 1 + 2i + 3j + 4k
125  octave:2> q2 = 1 + 2*qi + 3*qj + 4*qk
126  q2 = 1 + 2i + 3j + 4k
127  octave:3> 
128  @end group
129  @end example
130
131  @end deftypefn
132
133
134
135 # name: <cell-element>
136 # type: sq_string
137 # elements: 1
138 # length: 80
139  @deftypefn {Function File} {} qj
140  Create y-component of a quaternion's vector p
141
142
143
144 # name: <cell-element>
145 # type: sq_string
146 # elements: 1
147 # length: 2
148 qk
149
150
151 # name: <cell-element>
152 # type: sq_string
153 # elements: 1
154 # length: 355
155  @deftypefn {Function File} {} qk
156  Create z-component of a quaternion's vector part.
157
158  @example
159  q = w + x*qi + y*qj + z*qk
160  @end example
161
162  @strong{Example}
163  @example
164  @group
165  octave:1> q1 = quaternion (1, 2, 3, 4)
166  q1 = 1 + 2i + 3j + 4k
167  octave:2> q2 = 1 + 2*qi + 3*qj + 4*qk
168  q2 = 1 + 2i + 3j + 4k
169  octave:3> 
170  @end group
171  @end example
172
173  @end deftypefn
174
175
176
177 # name: <cell-element>
178 # type: sq_string
179 # elements: 1
180 # length: 80
181  @deftypefn {Function File} {} qk
182  Create z-component of a quaternion's vector p
183
184
185
186 # name: <cell-element>
187 # type: sq_string
188 # elements: 1
189 # length: 5
190 rot2q
191
192
193 # name: <cell-element>
194 # type: sq_string
195 # elements: 1
196 # length: 1058
197  -- Function File: Q = rot2q (AXIS, ANGLE)
198      Create unit quaternion Q which describes a rotation of ANGLE
199      radians about the vector AXIS.  This function uses the active
200      convention where the vector AXIS is rotated by ANGLE radians.  If
201      the coordinate frame should be rotated by ANGLE radians, also
202      called the passive convention, this is equivalent to rotating the
203      AXIS by -ANGLE radians.
204
205      *Inputs*
206     AXIS
207           Vector `[x, y, z]' describing the axis of rotation.
208
209     ANGLE
210           Rotation angle in radians.  The positive direction is
211           determined by the right-hand rule applied to AXIS.
212
213      *Outputs*
214     Q
215           Unit quaternion describing the rotation.
216
217      *Example*
218           octave:1> axis = [0, 0, 1];
219           octave:2> angle = pi/4;
220           octave:3> q = rot2q (axis, angle)
221           q = 0.9239 + 0i + 0j + 0.3827k
222           octave:4> v = quaternion (1, 1, 0)
223           v = 0 + 1i + 1j + 0k
224           octave:5> vr = q * v * conj (q)
225           vr = 0 + 0i + 1.414j + 0k
226           octave:6>
227
228
229
230
231
232 # name: <cell-element>
233 # type: sq_string
234 # elements: 1
235 # length: 80
236 Create unit quaternion Q which describes a rotation of ANGLE radians
237 about the v
238
239
240
241
242