Author: bugman Date: Thu Mar 7 15:46:56 2013 New Revision: 18663 URL: http://svn.gna.org/viewcvs/relax?rev=18663&view=rev Log: Created the lib.geometry.lines module for performing geometric operations with lines. This has one stub of a function lib.geometry.lines.closest_point() which will be used to find the closest point on a line to a given point. Added: trunk/lib/geometry/lines.py Modified: trunk/lib/geometry/__init__.py Modified: trunk/lib/geometry/__init__.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/geometry/__init__.py?rev=18663&r1=18662&r2=18663&view=diff ============================================================================== --- trunk/lib/geometry/__init__.py (original) +++ trunk/lib/geometry/__init__.py Thu Mar 7 15:46:56 2013 @@ -23,5 +23,5 @@ """The relax-lib geometry package - a library of functions for studies of geometry.""" __all__ = [ - '' + 'lines' ] Added: trunk/lib/geometry/lines.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/geometry/lines.py?rev=18663&view=auto ============================================================================== --- trunk/lib/geometry/lines.py (added) +++ trunk/lib/geometry/lines.py Thu Mar 7 15:46:56 2013 @@ -1,0 +1,38 @@ +############################################################################### +# # +# Copyright (C) 2013 Edward d'Auvergne # +# # +# This file is part of the program relax (http://www.nmr-relax.com). # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see <http://www.gnu.org/licenses/>. # +# # +############################################################################### + +# Module docstring. +"""Functions relating to line geometry.""" + + +def closest_point(line_pt1=None, line_pt2=None, point=None): + """Determine the closest position on the line to the given point. + + @keyword line_pt1: The first point defining the line. + @type line_pt1: numpy rank-1 array + @keyword line_pt2: The second point defining the line. + @type line_pt2: numpy rank-1 array + @keyword point: The point. + @type point: numpy rank-1 array + @return: The position on the line closest to the point. + @rtype: numpy rank-1 array + """ +