- Added brute force indexing support to ubcalc
- Added calculation of UB from 3 reflections to ubcalc - Added calculation of lattice constants from UB to ubcalc - Some fixes in stdscan in order to make the scripted scan work
This commit is contained in:
27
cell.c
27
cell.c
@ -147,4 +147,31 @@ int calculateBMatrix(lattice direct, MATRIX B) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
int cellFromUB(MATRIX UB, plattice direct){
|
||||
MATRIX UBTRANS, GINV, G;
|
||||
|
||||
UBTRANS = mat_tran(UB);
|
||||
if(UBTRANS == NULL){
|
||||
return CELLNOMEMORY;
|
||||
}
|
||||
GINV = mat_mul(UBTRANS,UB);
|
||||
if(GINV == NULL){
|
||||
mat_free(UBTRANS);
|
||||
return CELLNOMEMORY;
|
||||
}
|
||||
G = mat_inv(GINV);
|
||||
if(G == NULL){
|
||||
mat_free(UBTRANS);
|
||||
mat_free(GINV);
|
||||
return CELLNOMEMORY;
|
||||
}
|
||||
direct->a = sqrt(G[0][0]);
|
||||
direct->b = sqrt(G[1][1]);
|
||||
direct->c = sqrt(G[2][2]);
|
||||
direct->alpha = Acosd(G[1][2]/(direct->b * direct->c));
|
||||
direct->beta = Acosd(G[2][0]/(direct->a * direct->c));
|
||||
direct->gamma = Acosd(G[0][1]/(direct->a * direct->c));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user