http://chemapps.stolaf.edu/jmol/docs/?&search=quaternion%28%29#jmolmath

*The quaternion q = quaternion(script("show rotation")) (or, in Jmol 12.2,
just q = quaternion()) measures how much the model has been rotated from
its reference position (with x to the right, y to the top, and z toward the
user). It can be used to align any axis or plane with any other
"window-frame" axis. For example, here is a quaternion recipe for the
shortest rotation that takes atom "X" and puts it between the center of the
model and the user, that is, "in the forefront:"*

*q = quaternion(script("show rotation"))
toAtom = {C1}.xyz - {*}.xyz
toUser = (!q)%{0 0 1}
axis = cross(toAtom, toUser)
a = angle(toAtom, {0 0 0}, axis, toUser)
rotate MOLECULAR {0 0 0} @axis @a
*


On Fri, Feb 22, 2013 at 5:34 PM, Dan Kirshner <dan_kirsh...@yahoo.com>wrote:

> Excellent, thanks.
>
> But where is it that I can learn that there such a thing as "quaternion()"?
>
> --Dan
>
>
>   ------------------------------
> *From:* Robert Hanson <hans...@stolaf.edu>
> *To:* "jmol-users@lists.sourceforge.net" <jmol-users@lists.sourceforge.net>
>
> *Sent:* Friday, February 22, 2013 1:47 PM
> *Subject:* Re: [Jmol-users] Transfer show info from JSO to Javascript?
>
> sure, but
>
> quaternion()
>
> should do the same thing -- and we should think about the fact that with
> JSmol we don't need conversion from Java classes, since everything is
> JavaScript!
>
> Bob
>
>
>
> On Fri, Feb 22, 2013 at 1:51 PM, Paul Pillot <
> paul.pil...@ac-orleans-tours.fr> wrote:
>
> Jmol.evaluate(myJmol1,"script(show orientation)") will do !
> -Paul
>
> Le 22 févr. 2013 à 20:27, Dan Kirshner a écrit :
>
> Sorry, I'm just not getting how to do this.
>
> I'd like to get the quaternion info for the current model rotation and
> manipulate it in Javascript.
>
> I'm using the Jmol Javascript Object.  I'm happily running scripts with
> something like
>
>    var script = "<lots of commands>";
>    Jmol.script (myJmol1, script);
>
> The Jmol command
>
>    show orientation rotation;
>
> gives me the numbers I want -- in both the Jmol Script Console and in the
> Java Console.
>
> How do I get these numbers into a Javascript variable?
>
> Something like
>
>    var q = Jmol.getInfo (myJmol1, "show orientation rotation");
>
> is what I'm thinking, but I haven't found a variation that works!
>
> Thanks!
>
> --Dan
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
>
> http://p.sf.net/sfu/appdyn_d2d_feb_______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
>
> --
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> Chair, Chemistry Department
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Chemistry Department
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to