You can get as complicated as you want, but if you just need to calculate distances from atom to atom, then it don't really matter what helix they belong to, does it? So maybe

%atoms = ( 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 ], K => [ -0.696, 13.041, 22.357 ], L => [ 1.152, 11.081, 23.082 ], M => [ 2.200, 17.590, 18.424 ], );
is fine. But then I don't know what other problems you hope to solve. Structure your data in terms of the problems you need to solve, ignoring superfluous information.

Update: As an example of making things more complicated, if you need to retain all of the information, maybe your data structure would look like this (hashes all the way down):

%helixes = ( helix1 => { A => { x => -1.115, y => 8.537, z => 7.075 }, B => { x => -2.745, y => 5.280, z=> 7.165 }, ... }, helix2 => { K => { x => -0.696, y => 13.041, z => 22.357 }, L => { x => 1.152, y => 11.081, z => 23.082 }, M => { x => 2.200, y => 17.590, z => 18.424 }, }, );

In reply to Re: confused with distances by duff
in thread confused with distances by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.