The angle between the directions [u1 v1 w1] and [u2 v2 w2] of a crystal with any cell (a, b, c, alpha, beta, gamma).
\cos\varphi = \frac{\mathbf d_1^{\mathsf T}G\,\mathbf d_2}{\sqrt{\mathbf d_1^{\mathsf T}G\,\mathbf d_1}\sqrt{\mathbf d_2^{\mathsf T}G\,\mathbf d_2}}
Inputs
a cell edge a [m]b cell edge b [m]c cell edge c [m]alpha cell angle alpha in degrees (between b and c)beta cell angle beta in degrees (between a and c)gamma cell angle gamma in degrees (between a and b)u1 index u of direction 1 integerv1 index v of direction 1 integerw1 index w of direction 1 integeru2 index u of direction 2 integerv2 index v of direction 2 integerw2 index w of direction 2 integer
Returns
angle_deg angle in degrees
Applies when
- a valid cell
- neither direction zero
Example
m.ask("Angle between lattice directions: a = 0.3 nm, b = 0.3 nm, c = 0.5 nm, alpha = 90, beta = 90, gamma = 120, u1 = 1, v1 = 0, w1 = 0, u2 = 0, v2 = 1, w2 = 0")
→ angle_deg = 120