Yuan,

On Mon, Sep 13, 2010 at 6:12 PM, 商元 <shangyuan5...@gmail.com> wrote:
> Thanks, lan.
>
> For quaternions, it needs w^2+x^2+y^2+z^2=1, thus reduces variables to 3.

The number of degrees of freedom is of course reduced to 3 but the
number of variables is still to all intents and purposes 4, since no
useful simplification is achieved by eliminating one of the variables
using the above constraint (normalisation) equation.  If you wanted to
do an optimisation using quaternions as variables you would almost
certainly use constrained optimisation with 4 variables/quaternion.
All the standard formulae that involve quaternions are in terms of the
4 variables (w,x,y,z).

> But fortunately,(x,y,z) here only represents a direction of the rotation
> angle, and the absolute value of them are not that important.
> I think a rotation vector and the rotation angle could be a very good
> representation of any rotation in 3D space, and that's more directviewing
> than the rotation Matrix which is a Matrix, or Euler Angles, which need
> three rotation angles.

How appropriate a particular representation is obviously depends on
the purpose for which you are using it.  I accept that the quaternion
representation may well be the most appropriate one for your
particular problem.  The article I sent discusses the pros and cons of
each (and they all have both pros and cons!).

> The Exponential Map, it's too complicated, so many mathematics....

Complicated?  I didn't think it could get any simpler!  Here's a comparison:

                                         Quaternion (q)
   Exp. map (v)

No of variables                           4
         3
Constraint                     w^2+x^2+y^2+z^2=1                      -
Angle of rotation (A)          2 cos^(-1)(w/|q|)                         |v|
Axis vector                     (x,y,z)/(|q|sin(A/2))                      v/A

where q is the quaternion before normalisation.

> the definition of q = e^v, I think they are identical. and the direction of
> v is identical to (x,y,z) in the quaternion.

Not exactly identical: the expressions for angle & axis vector are
quite different as can be seen from the above definitions.  However
for a given rotation they clearly must have the same value (by
definition!) if that's what you mean.

Cheers

-- Ian
>
> Regards,
>
> Yuan SHANG
>
> On Tue, Sep 14, 2010 at 12:09 AM, Ian Tickle <ianj...@gmail.com> wrote:
>>
>> Hi Yuan
>>
>> You might want to look at the 'exponential map' as an alternative to
>> quaternions.  This article evaluates all the various representations
>> of rotations, including Eulerian angles, polar angles, rotation
>> matrices, quaternions etc:
>>
>> http://webhome.cs.uvic.ca/~blob/courses/485c/notes/pdf/expmap.pdf
>>
>> The advantage of the exponential map representation is that only 3
>> variables are used, which, as for the Eulerian & polar angle
>> representations, is exactly the number that are needed to represent an
>> arbitrary rotation in 3-D so it's an optimally parsimonious
>> representation.  However it doesn't suffer from the well-known
>> singularities as Eulerian & polar angles (it suffers from different
>> singularities but it's possible to "sweep them under the carpet").
>> Quaternions, as you say, require 4 variables but a constraint is
>> needed (i.e. normalisation of the vector) to reduce it back to 3.
>>
>> Cheers
>>
>> -- Ian
>>
>> On Mon, Sep 13, 2010 at 4:21 PM, 商元 <shangyuan5...@gmail.com> wrote:
>> > Dear CCP4 members,
>> >     I have finally used Eleanor's idea, and it works very well. After
>> > applying SSM, we can get a rotation matrix(M), and a displacement vector
>> > N:
>> >      (Xnew,Ynew,Znew)'=M*(X,Y,Z)'+N
>> > Then, from the rotation matrix M, we can get its another representative
>> > format-----quaternion number.  The quaternion number has 4 elements, the
>> > first element(w) of which represents the cosine value of half of the
>> > rotation anger, and the next 3 elements(x0,y0,z0) represent the rotation
>> > vector. That means the molecule rotates an angle of acos(w)*2*180/pi
>> > degrees
>> > around the vector (x0,y0,z0).
>> >    The attached file is the matlab program i wrote to translate M into a
>> > quaternion number. That should be very easy to be translated into other
>> > language formats.
>> >
>> > Best & regards,
>> > Yuan SHANG
>> >
>> >
>> >
>> > On Thu, Aug 19, 2010 at 7:34 PM, Frances C. Bernstein
>> > <f...@bernstein-plus-sons.com> wrote:
>> >>
>> >> Pete Artymiuk wrote:
>> >> -----------------------
>> >> I have an old badly-written Fortran program (I wrote it for a Vax, but
>> >> it
>> >> still compiles and runs in g95 - isn't Fortran wonderful?)  that takes
>> >> Arnott & Dover's polar coordinates and converts them to a helix of any
>> >> required length* in PDB (or Diamond!) format.
>> >> -----------------------
>> >>
>> >> Wow, that is an old program!
>> >>
>> >> For everyone under the ago of 60 reading this list, Diamond
>> >> format was the very first PDB format, used for the first 100
>> >> or so entries that we had.  It was based on the output format
>> >> of the Diamond real-space refinement program and each line was
>> >> 132 characters long.  Long lines were awkward, in some ways,
>> >> to handle on computers of that time so we designed what is
>> >> now known as PDB format.  If you want to know more, you can
>> >> look at page 9 of the September 1974 PDB Newsletter (available
>> >> on the RCSB web site if you start at
>> >>
>> >>
>> >> http://www.rcsb.org/pdb/static.do?p=general_information/news_publications/newsletters/newsletter.html#pre1999)
>> >> for the format of coordinate records in the original format.
>> >>
>> >> The reason that I know that there were about 100 entries
>> >> released in the original format is that I was the one who had
>> >> to convert them all into the new PDB format in 1976.
>> >>
>> >>                       Frances Bernstein
>> >>
>> >> =====================================================
>> >> ****                Bernstein + Sons
>> >> *   *       Information Systems Consultants
>> >> ****    5 Brewster Lane, Bellport, NY 11713-2803
>> >> *   * ***
>> >> **** *            Frances C. Bernstein
>> >>  *   ***      ...@bernstein-plus-sons.com
>> >>  ***     *
>> >>  *   *** 1-631-286-1339    FAX: 1-631-286-1999
>> >> =====================================================
>> >
>> >
>
>

Reply via email to