Files
sics/ubfour.h
2005-03-23 08:19:47 +00:00

41 lines
1.1 KiB
C

/**
* This is a library for calculating UB matrices for four circle diffraction.
* The algorithm and setting definitions is from:
* Busing & Levy, Acta Cryst. (1967), 22, 457ff
*
* This initial version only supports the calculation of the UB matrix from
* cell constants and two reflections.
*
* Mark Koennecke, march 2005
*/
#ifndef SICSUBFOUR
#define SICSUBFOUR
#include <stdio.h>
#include "matrix/matrix.h"
#include "cell.h"
/**
* error codes: also see cell.h
*/
#define UBNOMEMORY -200
/**
* a reflection data structure holding the indices h,k,l and
* the magic four circle angles two_theta, om, chi and phi.
*/
typedef struct{
double h,k,l;
double s2t,om,chi,phi;
}reflection;
/**
* calculate a UB matrix from cell constants and two reflections
* @param direct The direct cell constants
* @param r1 The first reflection.
* @param r2 The second reflection.
* @param errCode an error indicator if things go wrong.
* @return The resulting UB matrix or NULL on errors
*/
MATRIX calcUBFromCellAndReflections(lattice direct, reflection r1, reflection r2, int *errCode);
#endif