View Single Post
Join Date: Dec 2005
Posts: 5,851
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: distance calculation for XYZ coordiantes

 
0
  #2
Oct 1st, 2008
> my exiting code:
Really....
http://www.daniweb.com/forums/post702120-2.html
Try to reply to existing threads which cover basically the same topic as before.

In your loop, having worked out the distance between
6.324 32.707 50.379
5.197 32.618 46.826
ie, lines 1 and 2

Would you then need to work out the distance between
5.197 32.618 46.826
4.020 36.132 46.259
ie, lines 2 and 3

Something like
  1. my @old;
  2. open (IN, "filename.pdb") or die "$!";
  3. while (my $line = <IN>) {
  4. chomp($line);
  5. my @array = (split(/\s+/,$line))[6,7,8];
  6. print "@array\n";
  7. if ( $. > 1 ) {
  8. # now work out distance between @old and @array
  9. }
  10. @old = @array;
  11. }
  12. close (IN);
Reply With Quote