# [gmx-users] editconf subroutine

Tsjerk Wassenaar tsjerkw at gmail.com
Thu Oct 9 09:14:07 CEST 2008

```Hi Maria,

The answer is in the source code of course. But here's a python/pymol
function which does the same thing, and which I wrote after the
routine in editconf. It takes as input the definition as a list with
lengths x,y,z and angles a,b,c and returns the upper triangular
matrix:

def triclinic(L):
B = [[0,0,0],[0,0,0],[0,0,0]]

x, y, z, a, b, c = L[:6]

B = x
if a == 90 and b == 90 and c == 90:
B = y
B = z
else:
a = a*pi/180
b = b*pi/180
c = c*pi/180
B = y*cos(c)
B = y*sin(c)
B = z*cos(b)
B = z*(cos(a)-cos(b)*cos(c))/sin(c)
B = sqrt(z*z-B**2-B**2)

return B

Cheers,

Tsjerk
On Thu, Oct 9, 2008 at 6:04 AM, Maria Ratajczak <mkratajczak at gmail.com> wrote:
> Hello,
> I how does editconf subroutine calculate the triclinc box dimensions (v1(x),
> v2(y), v3(z), v1(y) etc) from, for example, a .pdf file that has
> lattice dimensions information (a, b, c, alpha, beta, gamma).
> I would really appreciate a mathematical formula for each of these elements
> (v1(x), v2(y), v3(z), v1(y) etc) or at least where can I find this
> information?
> Thank you
> maria
> _______________________________________________
> gmx-users mailing list    gmx-users at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-users
> Please search the archive at http://www.gromacs.org/search before posting!
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-users-request at gromacs.org.
>

--
Tsjerk A. Wassenaar, Ph.D.
Junior UD (post-doc)
Biomolecular NMR, Bijvoet Center
Utrecht University