Advertisement
Guest User

Untitled

a guest
May 15th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 1.69 KB | None | 0 0
  1. (define (read-xyz)
  2.   (let ((natoms (read))                 ; number of atoms
  3.         (rest-of-line (read-line))      ; discard the rest of the line
  4.         (comment-line (read-line)))     ; any text
  5.     (let loop ((n natoms)
  6.                (acc '()))
  7.       (if (zero? n)
  8.           ;; (list natoms rest-of-line comment (reverse acc))
  9.           (list natoms comment-line (reverse acc))
  10.           (let ((symbol (read))
  11.                 (x (read))
  12.                 (y (read))
  13.                 (z (read)))
  14.             (loop (- n 1)
  15.                   (cons (list symbol (list x y z)) acc)))))))
  16.  
  17. 15
  18. This is uranyl with some waters
  19. U      -0.414633333333333      0.213933333333333      0.048566666666667
  20. O       1.186425751635119      0.980622195189284      0.121046706417034
  21. O      -2.015692418301786     -0.552755528522618     -0.023913373083700
  22. O      -1.400296137734070      2.330651998063650     -0.474962349653488
  23. H      -2.374231172314353      2.490621981130683     -0.635773272586715
  24. H      -0.901393783370848      3.192476432338561     -0.566368505340978
  25. O       0.580464534891958     -1.904327988632390      0.553410186515704
  26. H       0.085625448774497     -2.768968442594905      0.640192467091476
  27. H       1.556649317569456     -2.062595989295014      0.701783061513602
  28. O      -0.109385653277192     -0.209486930054325     -2.286303549628824
  29. H      -0.768228170218269     -0.667146175042155     -2.883358449405985
  30. H       0.699067364115980      0.046446395180368     -2.816305296514802
  31. O      -0.722212952773571      0.638425892167969      2.384031196221085
  32. H      -1.532165379339123      0.390423939301528      2.915512238286563
  33. H      -0.057700948432124      1.089330366457678      2.979941383373171
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement