Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 2092 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

confused with distances Perl

Thread title: confused with distances Perl
Closed Thread    
    Thread tools Search this thread Display Modes  
03-23-2006, 06:13 PM
#1
ktsirig is offline ktsirig
Status: Junior Member
Join date: Oct 2005
Location:
Expertise:
Software:
 
Posts: 46
iTrader: 0 / 0%
 

ktsirig is on a distinguished road

  Old  confused with distances Perl

Hello all,
I have a school assignment in Biology but I seem to be unable to begin...
What I was given is something like the following :


HELIX1: x y z
A 1 -1.115 8.537 7.075
B 2 -2.745 5.280 7.165
C 3 -0.777 3.267 7.329
D 4 1.610 5.225 10.885
E 5 0.296 5.263 10.912

HELIX2:
K 1 -0.696 13.041 22.357
L 2 1.152 11.081 23.082
M 3 2.200 17.590 18.424

What I must do is :
take each atom from each helix (for example atoms A, B, C, D, E from helix1 , atoms K,L,M from helix2)
and calculate the distance from all other atoms of the remaining helices.
An example :
1) Take atom A from helix1
2) Calculate distance with atom K from helix2
3) Calculate distance with atom L from helix2
4) Calculate distance with atom M from helix2

In order to calculate the distance ,for example, between A(helix1) and K(helix2), I use the formula:
distance = (Xa-Xk)^2 + (Ya-Yk)^2 + (Za-Zk)^2

So, what I need to store is :
x,y,z for each atom
then, using the formula above ,I will calculate the distance...
I don't know if I need a hash of arrays, an array of hashes or something more or less complicated...
Any help?

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed