Author: bugman Date: Wed Feb 13 16:49:41 2008 New Revision: 4980 URL: http://svn.gna.org/viewcvs/relax?rev=4980&view=rev Log: The unit vector between the pivot and CoM is now calculated. Modified: branches/N_state_model/specific_fns/n_state_model.py Modified: branches/N_state_model/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/specific_fns/n_state_model.py?rev=4980&r1=4979&r2=4980&view=diff ============================================================================== --- branches/N_state_model/specific_fns/n_state_model.py (original) +++ branches/N_state_model/specific_fns/n_state_model.py Wed Feb 13 16:49:41 2008 @@ -23,6 +23,7 @@ # Python module imports. from math import pi from numpy import array, float64, zeros +from numpy.linalg import norm from re import search # relax module imports. @@ -107,8 +108,6 @@ # Set the pivot point. cdp.pivot_point = pivot_point - - # Print out. print "\nThe pivot point of the domain motions is:\n" + `cdp.pivot_point` + "\n" # The centre has been supplied. @@ -121,6 +120,12 @@ # Print out. print "The initial centre of mass (prior to rotation) for the moving domain is:\n" + `cdp.CoM` + "\n" + + # Calculate the unit vector between the pivot and CoM points. + unit_vect = array(cdp.CoM, float64) - array(cdp.pivot_point, float64) + unit_vect = unit_vect / norm(unit_vect) + print "The unit vector between the pivot and CoM is:\n" + `unit_vect` + "\n" + raise NameError, `unit_vect` def default_value(self, param):