no simple way. HOWEVER, you could do the calculation I think. Let's see
if it can be done with a Jmol script...
Let's say we want to align the axis between atom 1 and atom 2 along the
Z axis.
Y
|
+--X
/
Z
Strategy: rotate the axis around the Z axis into the XZ plane, then
rotate it around the Y axis into the Z plane.
To do this, we need two angles:
a) the angle of the axis projected into the XY plane and the X axis,
and, after that,
b) the angle between the axis and the Z axis.
try this:
#atoms to align along the Z axis:
a1 = 1
a2 = 5
# just for testing:
select *;color cpk;
select atomno=a1;color yellow;spacefill 0.40;
select atomno=a2;color green;spacefill 0.25
select atomno=a1 or atomno=a2; label on
set axesmolecular
axes on
# align molecular and window frame coordinate system;
reset
select *
# move atom 1 to {0 0 0}:
x = -{atomno=a1}.x
y = -{atomno=a1}.y
z = -{atomno=a1}.z
translateSelected [EMAIL PROTECTED] @y @z}
# into the XZ plane:
axisAB = {atomno=a2}.xyz - {atomno=a1}.xyz
x = axisAB.x
y = axisAB.y
#echo %{x} %{y}
projAB = [EMAIL PROTECTED], @y, 0}
angleA = angle(projAB, {0 0 0}, {1 0 0})
if (y > 0)
angleA = -angleA
endif
#echo %{angleA}
rotateSelected Z @angleA
# move atom 1 to {0 0 0}:
x = -{atomno=a1}.x
y = -{atomno=a1}.y
z = -{atomno=a1}.z
translateSelected [EMAIL PROTECTED] @y @z}
# onto the Z axis:
axisAB = {atomno=a2}.xyz - {atomno=a1}.xyz
x = axisAB.x
z = axisAB.z
#echo %{x} %{z}
projAB = [EMAIL PROTECTED], 0, @z}
angleA = -angle(projAB, {0 0 0}, {0 0 1})
echo %{angleA}
rotateSelected Y @angleA
# move atom 1 to {0 0 0}:
x = -{atomno=a1}.x
y = -{atomno=a1}.y
z = -{atomno=a1}.z
translateSelected [EMAIL PROTECTED] @y @z}
This works for me, but this sort of thing is tricky; I may have not
accounted for all possibilities. In any case, you get the idea from this
of what is possible now with arithmetic expressions. Certainly you can
do what you want to do.
Nice application of rotateSelected and translateSelected, I think.
Bob
Dean Johnston wrote:
>Exactly. I want to be able to "look down" a particular molecular axis - so
>I guess that might be "orient this bond along the Z axis".
>
>Dean
>
>
>On 6/14/07 10:45 PM, "Bob Hanson" <[EMAIL PROTECTED]> wrote:
>
>
>
>>Dean,
>>
>>There are two coordinate systems -- that of the molecule and that of the
>>reference frame. Is what you are asking to do to align some axis in the
>>molecular system with some axis in the reference plane? In other words,
>>something like "orient the axis going through atoms 1 and 2 along the X
>>(horizontal) axis"?
>>
>>
>>Bob Hanson
>>
>>
>>Dean Johnston wrote:
>>
>>
>>
>>>Jmol users,
>>>
>>> Does anybody know a simple way to align a molecule in the Jmol viewer
>>>along a bond or (arbitrary) axis? This axis may not correspond to one of
>>>the original x, y, or z axes. (or front, back, top, etc.) I know you can
>>>ROTATE around an arbitrary axis. I also know you can also NAVIGATE along a
>>>PATH, but I just want to re-orient, not move anywhere. Am I overlooking
>>>some obvious parameter to MOVETO? Thanks for any tips.
>>>
>>>Dean
>>>
>>>
>..
>
>
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version of DB2 express and take
>control of your XML. No limits. Just data. Click to get it now.
>http://sourceforge.net/powerbar/db2/
>_______________________________________________
>Jmol-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users