The Museum of HP Calculators


hkl (Miller indices) for the HP 48G

This program is by Ed Look and is used here by permission.

This program is supplied without representation or warranty of any kind. Ed Look and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

Overview

Calculates Miller indices of planes x-ray reflection from a cubic unit cell from input of 2-theta values from powder pattern and lattice parameter...

Listing

«
  "Enter 2θ values:"
  PROMPT DEPTH →LIST
  SORT REVLIST OBJ→ 0
  “Enter lattice parameter a:”
  PROMPT → dep c a
  «
    DO ‘c’ INCR
      DROP 2 a * SQ SWAP
      2 ÷ SIN SQ * 1.54
      SQ ÷ DUP FP
      IF .5 <
      THEN IP
      ELSE IP 1 +
      END
      DUP 3 0 →
      dep d
      «
          DO ‘d’ INCR
            DROP DUP √ IP DUP
            SQ ROT SWAP ­
          UNTIL ‘dep’
            ‘d’ ==
          END
          DROP 3
          →LIST
      » DEPTH ROLLD
      DEPTH ROLLD
    UNTIL ‘dep’ ‘c’
      ==
    END
   »
»

Go back to the software library
Go back to the main exhibit hall