# doc-cache created by Octave 10.2.0
# name: cache
# type: cell
# rows: 3
# columns: 7
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
q2rot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1572
 -- Function File: [AXIS, ANGLE] = q2rot (Q)
 -- Function File: [AXIS, ANGLE, QN] = q2rot (Q)
     Extract vector/angle form of a unit quaternion Q.

     *Inputs*
     Q
          Unit quaternion describing the rotation.  Quaternion Q can be
          a scalar or an array.  In the latter case, Q is reshaped to a
          row vector and the return values AXIS and ANGLE are
          concatenated horizontally, accordingly.

     *Outputs*
     AXIS
          Eigenaxis as a 3-d unit vector ‘[x; y; z]’.  If input argument
          Q is a quaternion array, AXIS becomes a matrix where AXIS(:,I)
          corresponds to Q(I).
     ANGLE
          Rotation angle in radians.  The positive direction is
          determined by the right-hand rule applied to AXIS.  The angle
          lies in the interval [0, 2*pi].  If input argument Q is a
          quaternion array, ANGLE becomes a row vector where ANGLE(I)
          corresponds to Q(I).
     QN
          Optional output of diagnostic nature.  ‘qn = reshape (q, 1,
          [])’ or, if needed, ‘qn = reshape (unit (q), 1, [])’.

     *Example*
          octave:1> axis = [0; 0; 1]
          axis =

             0
             0
             1

          octave:2> angle = pi/4
          angle =  0.78540
          octave:3> q = rot2q (axis, angle)
          q = 0.9239 + 0i + 0j + 0.3827k
          octave:4> [vv, th] = q2rot (q)
          vv =

             0
             0
             1

          th =  0.78540
          octave:5> theta = th*180/pi
          theta =  45.000
          octave:6>


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Extract vector/angle form of a unit quaternion Q.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2
qi


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 311
 -- Function File: qi
     Create x-component of a quaternion's vector part.

          q = w + x*qi + y*qj + z*qk

     *Example*
          octave:1> q1 = quaternion (1, 2, 3, 4)
          q1 = 1 + 2i + 3j + 4k
          octave:2> q2 = 1 + 2*qi + 3*qj + 4*qk
          q2 = 1 + 2i + 3j + 4k
          octave:3>


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Create x-component of a quaternion's vector part.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2
qj


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 311
 -- Function File: qj
     Create y-component of a quaternion's vector part.

          q = w + x*qi + y*qj + z*qk

     *Example*
          octave:1> q1 = quaternion (1, 2, 3, 4)
          q1 = 1 + 2i + 3j + 4k
          octave:2> q2 = 1 + 2*qi + 3*qj + 4*qk
          q2 = 1 + 2i + 3j + 4k
          octave:3>


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Create y-component of a quaternion's vector part.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2
qk


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 311
 -- Function File: qk
     Create z-component of a quaternion's vector part.

          q = w + x*qi + y*qj + z*qk

     *Example*
          octave:1> q1 = quaternion (1, 2, 3, 4)
          q1 = 1 + 2i + 3j + 4k
          octave:2> q2 = 1 + 2*qi + 3*qj + 4*qk
          q2 = 1 + 2i + 3j + 4k
          octave:3>


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Create z-component of a quaternion's vector part.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
rot2q


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1281
 -- Function File: Q = rot2q (AXIS, ANGLE)
     Create unit quaternion Q which describes a rotation of ANGLE
     radians about the vector AXIS.  This function uses the active
     convention where the vector AXIS is rotated by ANGLE radians.  If
     the coordinate frame should be rotated by ANGLE radians, also
     called the passive convention, this is equivalent to rotating the
     AXIS by -ANGLE radians.

     *Inputs*
     AXIS
          Vector ‘[x, y, z]’ or ‘[x; y; z]’ describing the axis of
          rotation.
     ANGLE
          Rotation angle in radians.  The positive direction is
          determined by the right-hand rule applied to AXIS.  If ANGLE
          is a real-valued array, a quaternion array Q of the same size
          is returned.

     *Outputs*
     Q
          Unit quaternion describing the rotation.  If ANGLE is an
          array, Q(I,J) corresponds to the rotation angle ANGLE(I,J).

     *Example*
          octave:1> axis = [0, 0, 1];
          octave:2> angle = pi/4;
          octave:3> q = rot2q (axis, angle)
          q = 0.9239 + 0i + 0j + 0.3827k
          octave:4> v = quaternion (1, 1, 0)
          v = 0 + 1i + 1j + 0k
          octave:5> vr = q * v * conj (q)
          vr = 0 + 0i + 1.414j + 0k
          octave:6>


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Create unit quaternion Q which describes a rotation of ANGLE radians
about th...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
rotm2q


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 90
 -- Function File: Q = rotm2q (R)
     Convert 3x3 rotation matrix R to unit quaternion Q.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Convert 3x3 rotation matrix R to unit quaternion Q.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
test_quaternion


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 74
 -- Script File: test_quaternion
     Execute all available tests at once.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Execute all available tests at once.





