ccp4_unitcell.h File Reference

C library for manipulations based on cell parameters. More...

#include <math.h>

Go to the source code of this file.

Functions

double ccp4uc_frac_orth_mat (const double cell[6], const int ncode, double ro[3][3], double rf[3][3])
double ccp4uc_calc_rcell (const double cell[6], double rcell[6])
void ccp4uc_orth_to_frac (const double rf[3][3], const double xo[3], double xf[3])
void ccp4uc_frac_to_orth (const double ro[3][3], const double xf[3], double xo[3])
void ccp4uc_orthu_to_fracu (const double rf[3][3], const double uo[6], double uf[6])
void ccp4uc_fracu_to_orthu (const double ro[3][3], const double uf[6], double uo[6])
double ccp4uc_calc_cell_volume (const double cell[6])
int ccp4uc_cells_differ (const double cell1[6], const double cell2[6], const double tolerance)
int ccp4uc_is_rhombohedral (const float cell[6], const float tolerance)
int ccp4uc_is_hexagonal (const float cell[6], const float tolerance)


Detailed Description

C library for manipulations based on cell parameters.

Author:
Martyn Winn

Function Documentation

double ccp4uc_calc_cell_volume ( const double  cell[6]  ) 

Calculate cell volume from cell parameters.

Parameters:
[in] cell direct space cell parameters
Returns:
Cell volume.

Referenced by ccp4uc_calc_rcell(), and ccp4uc_cells_differ().

double ccp4uc_calc_rcell ( const double  cell[6],
double  rcell[6] 
)

From input cell, find dimensions of reciprocal cell.

Parameters:
[in] cell direct space unit cell parameters.
[out] rcell reciprocal space unit cell parameters.
Returns:
Reciprocal cell volume

References ccp4uc_calc_cell_volume().

int ccp4uc_cells_differ ( const double  cell1[6],
const double  cell2[6],
const double  tolerance 
)

Check cells agree within tolerance.

Parameters:
[in] cell1 Cell parameters of first cell.
[in] cell2 Cell parameters of second cell.
[in] tolerance A tolerance for agreement.
Returns:
1 if cells differ by more than tolerance, 0 otherwise.

References ccp4_liberr_verbosity(), and ccp4uc_calc_cell_volume().

double ccp4uc_frac_orth_mat ( const double  cell[6],
const int  ncode,
double  ro[3][3],
double  rf[3][3] 
)

From input cell and orthogonalisation code, find orthogonalisation and fractionalisation matrices.

Parameters:
[in] cell unit cell parameters
[in] ncode orthogonalisation code:
  • ncode = 1 - xo along a zo along c*
  • ncode = 2 - xo along b zo along a*
  • ncode = 3 - xo along c zo along b*
  • ncode = 4 - trigonal only - xo along a+b yo alon a-b zo along c*
  • ncode = 5 - xo along a* zo along c
  • ncode = 6 - xo along a yo along b*
[out] ro orthogonalization matrix
[out] rf fractionalisation matrix
Returns:
Cell volume

References invert3matrix().

void ccp4uc_frac_to_orth ( const double  ro[3][3],
const double  xf[3],
double  xo[3] 
)

Convert fractional to orthogonal coordinates.

Parameters:
[in] ro orthogonalization matrix
[in] xf fractional coordinates
[out] xo orthogonal coordinates
Returns:
void

void ccp4uc_fracu_to_orthu ( const double  ro[3][3],
const double  uf[6],
double  uo[6] 
)

Convert fractional to orthogonal u matrix.

Parameters:
[in] ro orthogonalization matrix
[in] uf fractional u matrix
[out] uo orthogonal u matrix
Returns:
void

References ccp4_3matmul().

int ccp4uc_is_hexagonal ( const float  cell[6],
const float  tolerance 
)

Check if cell parameters conform to a hexagonal setting.

Parameters:
[in] cell Cell parameters. Angles are assumed to be in degrees.
[in] tolerance A tolerance for agreement.
Returns:
1 if cell parameters conform, 0 otherwise.

Referenced by ccp4spg_check_symm_cell().

int ccp4uc_is_rhombohedral ( const float  cell[6],
const float  tolerance 
)

Check if cell parameters conform to a rhombohedral setting.

Parameters:
[in] cell Cell parameters. Angles are assumed to be in degrees.
[in] tolerance A tolerance for agreement.
Returns:
1 if cell parameters conform, 0 otherwise.

Referenced by ccp4spg_check_symm_cell().

void ccp4uc_orth_to_frac ( const double  rf[3][3],
const double  xo[3],
double  xf[3] 
)

Convert orthogonal to fractional coordinates. Translation only if deliberate origin shift - does this ever happen? Leave it to the application.

Parameters:
[in] rf fractionalisation matrix
[in] xo orthogonal coordinates
[out] xf fractional coordinates
Returns:
void

void ccp4uc_orthu_to_fracu ( const double  rf[3][3],
const double  uo[6],
double  uf[6] 
)

Convert orthogonal to fractional u matrix.

Parameters:
[in] rf fractionalisation matrix
[in] uo orthogonal u matrix
[out] uf fractional u matrix
Returns:
void

References ccp4_3matmul().


Generated on Wed Oct 29 21:05:08 2008 for gpp4 by  doxygen 1.5.6