http://rip94550.wordpress.com/2008/05/20/axis-and-angle-of-rotation/
http://en.wikipedia.org/wiki/Rotation_representation_%28mathematics%29
http://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
Saturday, September 4, 2010
Rotation Matrix
A rotation matrix is a matrix which, when multiplied by the vector representing a point, has the effect of rotating that point around the origin. A rotation around the origin is a linear geometrical transformation.
In general, any orthogonal matrix with a determinant of 1 is a rotation matrix.
In two dimensions, the 2×2 matrix that rotates a 2D vector around the origin by an angle of θ is:
As with any other linear geometrical transformation, rotations may be composed by multiplying the matricies (see matrix multiplication) that represent them.
Rotations in 2D commute. That is, the rotation of a column vector v by θ1 and followed by the rotation by θ2 has the same effect as a single rotation by θ1+θ2. Of course, this seems obvious in 2D. In matrix form, this means that:
In general, any orthogonal matrix with a determinant of 1 is a rotation matrix.
In two dimensions, the 2×2 matrix that rotates a 2D vector around the origin by an angle of θ is:
(Note: the matrix should be multiplied from the right by a column vector.)R(θ) | cos(θ) -sin(θ) | = | | | sin(θ) cos(θ) |
As with any other linear geometrical transformation, rotations may be composed by multiplying the matricies (see matrix multiplication) that represent them.
Rotations in 2D commute. That is, the rotation of a column vector v by θ1 and followed by the rotation by θ2 has the same effect as a single rotation by θ1+θ2. Of course, this seems obvious in 2D. In matrix form, this means that:
The vectors forming the columns of the matrix are what the unit vectors along the axes are transformed to. In three dimensions, rotation matricies are more complex. It's easiest to start with rotations around the three coordinate axes:R(θ2)(R(θ1)v) = R(θ1+θ2)v
Rx(θ) | 1 0 0 | = | 0 cos(θ) -sin(θ) | | 0 sin(θ) cos(θ) |
Ry(θ) | cos(θ) 0 sin(θ) | = | 0 1 0 | | -sin(θ) 0 cos(θ) |
Here, Rx(θ) represents a rotation of θ around the x axis. Rotation about an arbitrary axis u is given by the following formula:Rz(θ) | cos(θ) -sin(θ) 0 | = | sin(θ) cos(θ) 0 | | 0 0 1 |
where u = [ ux uy uz ]T is a unit column vector and cross(u) is the cross product operator matrix. In addition, I is the 3×3 identity matrix, and the 3×3 matrix uuT is a projection matrix. Expanding the formula into a matrix, we getRu(θ) = uuT + cos(θ) (I - uuT) + sin(θ) cross(u)
where vθ = 1-cos(θ), cθ = cos(θ) and sθ = sin(θ). Given an rotation matrix, you can extract the axis u and angle θ of the rotation that it represents. Suppose the rotation matrix R is given by| uxuxvθ+cθ uxuyvθ-uzsθ uxuzvθ+uysθ | = | uyuxvθ+uzsθ uyuyvθ+cθ uyuzvθ-uxsθ | | uzuxvθ-uysθ uzuyvθ+uxsθ uzuzvθ+cθ |
Then we can calculateR | r11 r12 r13 | = | r21 r22 r23 | | r31 r32 r33 |
Note that u is undefined if θ is a multiple of 2π. That would mean that there actually is no rotation. Rotations in 3D do not commute. For example, a 90° rotation around the x axis followed by a 90° rotation around the z axis does not have the same effect as a 90° rotation around the z axis followed by a 90° rotation around the x axis.cosθ = ( r11 + r22 + r33 - 1) / 2 sinθ = ( (r21-r12)2 + (r13-r31)2 + (r32-r23)2 )1/2 / 2 ux = (r21-r12) / (2sinθ) uy = (r13-r31) / (2sinθ) uz = (r32-r23) / (2sinθ)
Tuesday, August 31, 2010
Using vpnc for cisco vpn (pcf file)
- install vpnc with synaptic
- open terminal, type sudo pico /etc/vpnc/default.conf
An example of default.conf:
IPSec gateway ip.to.vpn.server
IPSec ID VPNservergroupname
IPSec obfuscated secret cryptedpasswordfrompcffile
Xauth interactive - ctrl+x
- y
- sudo vpnc-connect
- enter your vpn user name, enter
- enter pin code or what ever kind of system you have, enter. Now you're inside vpn tunnel
- after you're done, sudo vpnc-disconnect
Monday, August 16, 2010
Running Hardware Driver as sudo on xubuntu
gksu -D /usr/share/applications/jockey-gtk.desktop /usr/bin/jockey-gtk
Wednesday, April 22, 2009
Building on 64 bit Linux system
If ./configure can't guess the right system try run a compiler like gcc:
> gcc -dumpmachine
x86_64-redhat-linux
If make gives error:
"xxx.so: could not read symbols: File in wrong format"
Maybe wrong library is loaded for compile:
./configure --target=x86_64-redhat-linux LDFLAGS=-L/usr/lib64
See http://www.c3.lanl.gov/~pakin/software/conceptual/userguide/Could-not-read-symbols.html
> gcc -dumpmachine
x86_64-redhat-linux
If make gives error:
"xxx.so: could not read symbols: File in wrong format"
Maybe wrong library is loaded for compile:
./configure --target=x86_64-redhat-linux LDFLAGS=-L/usr/lib64
See http://www.c3.lanl.gov/~pakin/software/conceptual/userguide/Could-not-read-symbols.html
Saturday, September 20, 2008
ViEmu commands
If you use Ctrl-V or Ctrl-Q to enter visual block mode, and select a range, you can key in any operator directly and it will be applied to the range. Here are some samples:
d Deletes the block (and copies it to the default register for later pasting)
y Yanks the block (copies to the default register)
gU Makes all characters uppercase
gu Makes all characters lowercase
~ Toggles the case of all characters
c Change - deletes the region, enters insert mode, and then repeats the string input in all lines (if we were initially in block visual mode)
etc...
The docs have a complete list of ViEmu-supported operators.
'x' also works to delete a visual region.
d Deletes the block (and copies it to the default register for later pasting)
y Yanks the block (copies to the default register)
gU Makes all characters uppercase
gu Makes all characters lowercase
~ Toggles the case of all characters
c Change - deletes the region, enters insert mode, and then repeats the string input in all lines (if we were initially in block visual mode)
etc...
The docs have a complete list of ViEmu-supported operators.
'x' also works to delete a visual region.
Thursday, August 7, 2008
Subscribe to:
Posts (Atom)