def calc_distance(x, y) #x, y???????´???°2??????1?¬??????????
  require 'bigdecimal'
  distance = ((y[0] - x[0])**2 + (y[1] - x[1])**2) ** 0.5
  distance_approximately = BigDecimal(distance.to_s).floor(8).to_f
  return distance_approximately #P1??¨P2????????¢
end

x = [0, 0]
y = [1, 1]

puts calc_distance(x, y)