| |
- axis_from_matrix(m)
- Factory method to create a rotation_axis object from a
direction cosine matrix
http://en.wikipedia.org/wiki/Rotation_representation_%28mathematics%29
- g_to_k(g, wavelength, axis=array([ 0., 0., 1.]), pre=None, post=None)
- Get the k and angles given the g in
g = pre . rot(axis, angle) . post . k
...where k will satisfy the Laue equations
The recipe is:
Find the components of g along and perpendicular to the rotation axis
co-ords are a0 = axis,
a1 = axis x g,
a2 = a1 x axis = ( axis x g ) x axis
Rotated vector will be a0 + a1 sin(angle) + a2 cos(angle)
Laue condition says that [incident beam].[k] = k.sin(theta)
= 2 sin^2(theta) / lambda
= sin(t)/d = |g|.sin(t)
= |g|*|g|*lambda / 2
Apply any post rotations to the incident beam
Apply any pre-rotations to the g vector
|g| = [a0 + a1 sin(angle) + a2 cos(angle) ] . [incident beam]
=> solve for angle
http://www.ping.be/~ping1339/gonio.htm
a sin(u) + b cos(u) = c
let: tan(u') = -b/a
and: A = a / cos(u')
Finally you'll find:
A.sin(u-u') = c
A.cos(pi/2 - u - u') = c
- k_to_g(k, angles, axis=<ImageD11.gv_general.rotation_axis instance at 0x2a9c40bea8>, pre=<ImageD11.gv_general.rotation_axis instance at 0x2a9c40b680>, post=<ImageD11.gv_general.rotation_axis instance at 0x2a9c40b680>)
- Computes g = pre . rot(axis, angle) . post . k
Typically in ImageD11 pre = [wedge][chi] and post = identity
|