# Created by Octave 3.8.1, Fri Aug 15 22:58:44 2014 CEST <marco@GE-MATZERI-EU>
# name: cache
# type: cell
# rows: 3
# columns: 6
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
q2rot


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

     *Inputs*
     Q
          Unit quaternion describing the rotation.

     *Outputs*
     AXIS
          Eigenaxis as a 3-d unit vector '[x, y, z]'.
     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].

     *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: 313
 -- 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: 313
 -- 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: 313
 -- 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: 1059
 -- 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]' describing the axis of rotation.
     ANGLE
          Rotation angle in radians.  The positive direction is
          determined by the right-hand rule applied to AXIS.

     *Outputs*
     Q
          Unit quaternion describing the rotation.

     *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 the v



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 76
 -- 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.





