def replaceRDiagonal(d, arr)
      d = d.to_i
      (0...arr.length).each do |i|
        xy = rDiagonalXY(d, i)
        self[xy['x'], xy['y']] = arr[i]
      end
    end
def replaceRDiagonal(d, arr)
      d = d.to_i
      (0...arr.length).each do |i|
        xy = rDiagonalXY(d, i)
        self[xy['x'], xy['y']] = arr[i]
      end
    end
Replace a diagonal line (bottom left to top right) of the image.