{
 "metadata": {
  "name": "",
  "signature": "sha256:1ec2372be7a9974010a31557c9658c85707025e7a87f82e6ef26be63dbcfb0e7"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3:Planes in Crystals"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.11 , Page no:61"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "h=3;\n",
      "k=2;\n",
      "l=1; #miller indices\n",
      "a=4.2E-8; #in cm (lattice constant)\n",
      "\n",
      "#calculate\n",
      "d=a/math.sqrt(h**2+k**2+l**2); #calculation for interplanar spacing\n",
      "d=d*1E8; #changing unit from cm to Angstrom\n",
      "\n",
      "#result\n",
      "print\"The interplanar spacing is d=\",round(d,2),\"cm\";\n",
      "print\"\\t\\t\\t   d=\",round(d,2),\"Angstrom\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The interplanar spacing is d= 1.12 cm\n",
        "\t\t\t   d= 1.12 Angstrom\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.12 , Page no:61"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "h=1;k=1;l=1; #miller indices\n",
      "a=2.5;b=2.5;c=1.8; #in Angstrom (lattice constants for tetragonal lattice )\n",
      "\n",
      "#calculate\n",
      "d=1/math.sqrt((h/a)**2+(k/b)**2+(l/c)**2); #calculation for interplanar spacing\n",
      "\n",
      "#result\n",
      "print\"The lattice spacing is d=\",round(d,2),\"Angstrom\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The lattice spacing is d= 1.26 Angstrom\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.15 , Page no:63"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "h=1;k=0;l=0; #miller indices\n",
      "a=2.5; #in Angstrom (lattice constant)\n",
      "\n",
      "#calculate\n",
      "a=a*1E-10; #hence a is in Angstrom\n",
      "d=a/math.sqrt(h**2+k**2+l**2); #calculation for interplanar spacing\n",
      "p=d/a**3;\n",
      "\n",
      "#result\n",
      "print\"The density is p=\",round(p),\"lattice points/m^2\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The density is p= 1.6e+19 lattice points/m^2\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}