The within selector allows you to make a selection of all atoms within a given radius form a point : select within (distance,{x y z}) It won't give you just the closest...
I think it is feasible with Jmol math, where you can create an array of atoms, then calculate an array of distances from a point (using the distance function) and sort that array to get the smallest distance. I am not literate enough in Jmol math subtleties to provide you with further hints... -Paul Le 30 mars 2011 à 02:06, Yingjie Lin a écrit : > Hi Jmolers, > > I need to find the nearest atom(s) to a given point. What I can think of is > the following: > > [pseudocode] > > get atoms within a 1*1 boundbox > if ( some atoms are found) { > return these atoms; > stop; > } else { > get atoms within a 2*2 boundbox; > if ( some atoms are found) { > return these atoms; > stop; > else { > ...... > } > } > [/pseudocode] > The searching stops at 5*5, since I am not interested in something that far > away. > Is there a better way to do this? > > Thank you. > > Yingjie ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users