Login

Welcome, Guest. Please login or register.

April 30, 2025, 03:25:26 am

Author Topic: Rotation in 3D space  (Read 1253 times)  Share 

0 Members and 1 Guest are viewing this topic.

Mao

  • CH41RMN
  • Honorary Moderator
  • Great Wonder of ATAR Notes
  • *******
  • Posts: 9181
  • Respect: +390
  • School: Kambrya College
  • School Grad Year: 2008
Rotation in 3D space
« on: August 17, 2010, 11:43:30 pm »
0
This belongs more to computer graphics than anything, but hey, we gotta start somewhere right? Here's hoping someone (like TT, /0, kamil, ahmad, dcc, etc) will stumble across and find this interesting.

A water molecule can be thought of as if it is in a tetrahedral conformation when it is in a regular ice (ice-1h) lattice. In this case, we ignore hydrogens except those on the central water molecule, thus each oxygen has four other oxygen neighbours. The central oxygen has a position vector , has two hydrogens (H-bond donors), and , both of which are hydrogen-bonded to oxygens and . Also, accept two hydrogen bonds from two other near-by water molecules, these two water molecules have oxygen centers at positions and .

Note that between O4 and O2, there is a H (but we ignore it). Same goes for O3 and O2.
Code: [Select]
       O4
       .
       .
       .
O3.....O2--H1.....O0
       |
       H2
       .
       O1

Now, the question is, I wish to rotate this molecule about the O2-H1 axis. If I define to be the angle between the plane O2-O1-H1 and O2-O3-H1, and I wish to rotate H2 by towards O3, is there a simple algorithm? Currently, my algorithm is rather painfully long.

The only information I have is position vectors, and that theta is roughly 120 degrees (the tetrahedron is slightly deformed, not perfect, thus why I can't cheat and simply give it new coordinates).

This is probably going to end up like one of my many queries that end up with zero responses, but if you take your time, I will be VERY grateful :)

Cheers,
« Last Edit: August 17, 2010, 11:45:03 pm by Mao »
Editor for ATARNotes Chemistry study guides.

VCE 2008 | Monash BSc (Chem., Appl. Math.) 2009-2011 | UoM BScHon (Chem.) 2012 | UoM PhD (Chem.) 2013-2015

Cthulhu

  • Guest
Re: Rotation in 3D space
« Reply #1 on: August 18, 2010, 12:27:18 am »
0
Hey Mao,
Interesting problem you have there. Just to add something to it and you've probably already looked at it: Have you tried rotation matricies?

Also, I know this is off topic but....
Now you're not doing Chem Eng and just straight science do you have to go through this SCI2010 nonsense or do you do SCI2020 or did you get exempt from it?

zzdfa

  • Victorian
  • Forum Obsessive
  • ***
  • Posts: 328
  • Respect: +4
Re: Rotation in 3D space
« Reply #2 on: August 18, 2010, 10:19:38 pm »
0
So from what I understand, you have a few points in space, and you want to rotate this configuration around some axis?

Could you sketch the  algorithm you are currently using?


Ahmad

  • Victorian
  • Part of the furniture
  • *****
  • Posts: 1296
  • *dreamy sigh*
  • Respect: +15
Re: Rotation in 3D space
« Reply #3 on: October 09, 2010, 10:42:50 am »
0
I'm a bit late on the scene so I'm not sure if this is helpful but one nice way to do this is via quaternions (which I don't know much about).

Quaternions are numbers of the form a + bi + cj + dk, similar to complex numbers but with these new 'indeterminates' or basis elements {1,i,j,k}, so it's essentially 4D space i.e. a + bi + cj + dk = (a,b,c,d). Adding numbers is done pointwise and multiplication is done by making use of the rule: from this any product of basis elements can be found. Note that multiplication is not commutative. One last thing is that 3D vectors (x,y,z) are often thought of as xi + yj + zk as per usual.

Say you have an axis of rotation (through the origin) with unit vector u pointing along this axis. And you want to rotate a point v around this axis by an angle t (if you point your thumb in the direction of axis of rotation then this is a rotation as per right hand rule). To do this let then is the rotated vector.

In your case you'll have to translate the axis so that it's at the origin, do the rotation then translate back. You can find more information here: http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation
« Last Edit: October 09, 2010, 10:52:06 am by Ahmad »
Mandark: Please, oh please, set me up on a date with that golden-haired angel who graces our undeserving school with her infinite beauty!

The collage of ideas. The music of reason. The poetry of thought. The canvas of logic.


Mao

  • CH41RMN
  • Honorary Moderator
  • Great Wonder of ATAR Notes
  • *******
  • Posts: 9181
  • Respect: +390
  • School: Kambrya College
  • School Grad Year: 2008
Re: Rotation in 3D space
« Reply #4 on: October 12, 2010, 12:06:21 am »
0
I ended up looking up an algorithm in a computer game design textbook, they had a 3D rotation matrix about some arbitrary axis that suited me just fine. :)
Editor for ATARNotes Chemistry study guides.

VCE 2008 | Monash BSc (Chem., Appl. Math.) 2009-2011 | UoM BScHon (Chem.) 2012 | UoM PhD (Chem.) 2013-2015