# Fractional coordinates

In crystallography, a fractional coordinate system is a coordinate system in which the edges of the unit cell are used as the basic vectors to describe the positions of atomic nuclei. The unit cell is a parallelepiped defined by the lengths of its edges a, b, c and angles between them α, β, γ as shown in the figure below.

Unit cell definition using parallelepiped with lengths a, b, c and angles between the sides given by α,β,γ[1]

## Conversion to cartesian coordinates

If the fractional coordinate system has the same origin as the cartesian coordinate system, the a-axis is collinear with the x-axis, and the b-axis lies in the xy-plane, fractional coordinates can be converted to cartesian coordinates through the following transformation matrix:[2][3][4]

$\begin{bmatrix} x \\ y \\ z \\ \end{bmatrix} = \begin{bmatrix} a & b\cos(\gamma) & c\cos(\beta) \\ 0 & b\sin(\gamma) & c\frac {\cos(\alpha)-\cos(\beta)\cos(\gamma)} {\sin(\gamma)} \\ 0 & 0 & c\frac {v} {\sin(\gamma)} \\ \end{bmatrix} \begin{bmatrix} \hat{a} \\ \hat{b} \\ \hat{c} \\ \end{bmatrix}$

where $v$ is the volume of a unit parallelepiped defined as

$v =\sqrt{1-\cos^2(\alpha)-\cos^2(\beta)-\cos^2(\gamma)+2\cos(\alpha)\cos(\beta)\cos(\gamma)}$

For the special case of a monoclinic cell (a common case) where α=γ=90° and β>90°, this gives:

$x=a\,x_{frac} + c\,z_{frac}\,\cos(\beta)$
$y=b\,y_{frac}$
$z=c\,v\,z_{frac} = c\, z_{frac}\,\sin(\beta)$

## Conversion from cartesian coordinates

The above fractional-to-cartesian transformation can be inverted as follows[5]

$\mathbf{\begin{bmatrix} \hat{a} \\ \hat{b} \\ \hat{c} \\ \end{bmatrix} = \begin{bmatrix} \frac{1}{a} & -\frac{\cos(\gamma)} {a\sin(\gamma)} & \frac{\cos(\alpha)\cos(\gamma)-\cos(\beta)}{av\sin(\gamma)} \\ 0 & \frac{1}{b\sin(\gamma)} & \frac{\cos(\beta)\cos(\gamma)-\cos(\alpha)}{bv\sin(\gamma)} \\ 0 & 0 & \frac {\sin(\gamma)} {cv} \\ \end{bmatrix}} \begin{bmatrix} x \\ y \\ z \\ \end{bmatrix}$

## References

http://www.ruppweb.org/Xray/tutorial/Coordinate%20system%20transformation.htm