Each atom has 3 positions.
You could use an associative array (i.e. hash) of positions (e.g. (x => $x, y => $y, z => $z)), but that's probably overkill.
Each atom can easily be represented by an array of positions (e.g. ($x, $y, $z)).
Each helix is made of atoms.
If you wish to name your atoms, a helix can easily be represented by an associative array (i.e. hash) of atom (e.g. (K => $atom0, L => $atom1, M => $atom2)).
If numerical indexes are sufficient identification for atoms, each helix can easily be represented by an array of atom (e.g. ($atom0, $atom1, $atom2)).
Let's go with names, since you already have names for them.
my %helix1 = ( A => [ -1.115, 8.537, 7.075 ], B => [ -2.745, 5.280, 7.165 ], C => [ -0.777, 3.267, 7.329 ], D => [ 1.610, 5.225, 10.885 ], E => [ 0.296, 5.263, 10.912 ], ); my %helix2 = ( K => [ -0.696, 13.041, 22.357 ], L => [ 1.152, 11.081, 23.082 ], M => [ 2.200, 17.590, 18.424 ], );
Each distance is has two index (the 'from' atom in the first helix and the 'to' atom in the second helix), so you'll need a 2D structure. We (I) decided above to use named atoms, so your distance map will be a 2D hash (e.g. $distance{A}{K} = distance($helix1{A}, $helix2{K});).
To populate %distance, think nested foreach loops. Good luck!
In reply to Re: confused with distances
by ikegami
in thread confused with distances
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |