def align_x(h,k,l)
      millerZ = self.cart_to_miller.column(2)
      unless 0 == dot([h,k,l], millerZ)
        raise "Specified vector [#{[h,k,l].join(',')}] is not orthogonal to z-axis [#{millerZ.to_a.join(',')}]"
      end

      # Define the current x axis and the new x-axis
      millerX = self.cart_to_miller.column(0)
      newX = Vector[h,k,l]

      # Find the angle between the current x direction and the new x-direction
      angle = acos(dot(newX*(1/newX.r), millerX*(1/millerX.r)))*180/Math::PI
      
      #Make the rotation in azimuth
      self.rotate(0, angle)

    end
def align_x(h,k,l)
      millerZ = self.cart_to_miller.column(2)
      unless 0 == dot([h,k,l], millerZ)
        raise "Specified vector [#{[h,k,l].join(',')}] is not orthogonal to z-axis [#{millerZ.to_a.join(',')}]"
      end

      # Define the current x axis and the new x-axis
      millerX = self.cart_to_miller.column(0)
      newX = Vector[h,k,l]

      # Find the angle between the current x direction and the new x-direction
      angle = acos(dot(newX*(1/newX.r), millerX*(1/millerX.r)))*180/Math::PI
      
      #Make the rotation in azimuth
      self.rotate(0, angle)

    end
Rotate the atoms about the z-axis so that the
 vector given by the miller index [h,k,l] is aligned
 with the cartesian unit vector [1,0,0]
 The vector [h,k,l] must be orthogonal to the defined
 miller index of the z-direction