Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
RotPDB.c
Go to the documentation of this file.
1 /************************************************************************/
2 /**
3 
4  \file RotPDB.c
5 
6  \version V1.1
7  \date August 1993
8  \brief Rotate a PDB linked list
9 
10  \copyright (c) UCL / Dr. Andrew C. R. Martin 1993
11  \author Dr. Andrew C. R. Martin
12  \par
13  Institute of Structural & Molecular Biology,
14  University College London,
15  Gower Street,
16  London.
17  WC1E 6BT.
18  \par
19  andrew@bioinf.org.uk
20  andrew.martin@ucl.ac.uk
21 
22 **************************************************************************
23 
24  This code is NOT IN THE PUBLIC DOMAIN, but it may be copied
25  according to the conditions laid out in the accompanying file
26  COPYING.DOC.
27 
28  The code may be modified as required, but any modifications must be
29  documented so that the person responsible can be identified.
30 
31  The code may not be sold commercially or included as part of a
32  commercial product except as described in the file COPYING.DOC.
33 
34 **************************************************************************
35 
36  Description:
37  ============
38 
39  Rotate a PDB linked list. Moves the structure to the origin first,
40  applies the rotation and moves back from the origin.
41 
42 **************************************************************************
43 
44  Usage:
45  ======
46 
47 **************************************************************************
48 
49  Revision History:
50  =================
51 
52 *************************************************************************/
53 /* Doxygen
54  -------
55  #GROUP Handling PDB Data
56  #SUBGROUP Moving the structure
57  #FUNCTION blRotatePDB()
58  Rotates a PDB linked list using ApplyMatrixPDB() which ignores
59  coordinates of 9999.0. The structure is moved to the origin, the
60  matrix is applied and the structure is moved back.
61 */
62 /************************************************************************/
63 /* Includes
64 */
65 #include <stdlib.h>
66 
67 #include "MathType.h"
68 #include "pdb.h"
69 #include "macros.h"
70 
71 /************************************************************************/
72 /* Defines
73 */
74 
75 /************************************************************************/
76 /* Prototypes
77 */
78 
79 /************************************************************************/
80 /* Variables global to this file only
81 */
82 
83 
84 /************************************************************************/
85 /*>void blRotatePDB(PDB *pdb, REAL matrix[3][3])
86  ---------------------------------------------
87 *//**
88 
89  \param[in,out] *pdb PDB linked list to rotate
90  \param[in] matrix Rotation matrix
91 
92  Rotates a PDB linked list using ApplyMatrixPDB() which ignores
93  coordinates of 9999.0. The structure is moved to the origin, the
94  matrix is applied and the structure is moved back.
95 
96 - 30.09.92 Original
97 - 01.10.92 Added check on NULL coordinates
98 - 22.07.93 Moves to origin first; calls ApplyMatrixPDB() to do the work
99 - 07.07.14 Renamed to blRotatePDB(). Use bl prefix for functions. By: CTP
100 */
101 void blRotatePDB(PDB *pdb, REAL matrix[3][3])
102 {
103  VEC3F CofG;
104 
105  blGetCofGPDB(pdb, &CofG);
106  blOriginPDB(pdb);
107 
108  blApplyMatrixPDB(pdb, matrix);
109 
110  blTranslatePDB(pdb, CofG);
111 }
112 
Include file for PDB routines.
Definition: pdb.h:298
Useful macros.
Definition: MathType.h:69
double REAL
Definition: MathType.h:67
void blRotatePDB(PDB *pdb, REAL matrix[3][3])
Definition: RotPDB.c:101
void blGetCofGPDB(PDB *pdb, VEC3F *cg)
Definition: GetCGPDB.c:98
void blOriginPDB(PDB *pdb)
Definition: OriginPDB.c:96
Type definitions for maths.
void blTranslatePDB(PDB *pdb, VEC3F tvect)
Definition: TranslatePDB.c:95
void blApplyMatrixPDB(PDB *pdb, REAL matrix[3][3])
Definition: ApMatPDB.c:92